Database Object Case-Sensitivity

Database objects allow you to store, reference, and operate on data. For example, tables store data, views and indexes reference data, and stored procedures and functions operate on data. Columns are not database objects.

Note

You can only change the setting of the variable table_name_case_sensitivity when the cluster is empty. That is, the cluster must contain no user databases.

The engine variable table_name_case_sensitivity defines the case-sensitivity of a database object. When this variable is set to ON (the default setting), all database objects are case-sensitive, except:

  • Stored procedures

  • User-defined scalar-valued functions (UDFs)

  • User-defined aggregate functions (UDAFs)

  • information_schema table names

When the variable is set to OFF, the four database objects noted in the previous list are case-insensitive, in addition to the following database objects.

  • Tables

  • Views

  • Table aliases

  • User-defined table-valued functions (TVFs)

  • External functions

Pipeline names are always case-sensitive.

The following example shows how you can refer to an existing table test_table. This example assumes table_name_case_sensitivity is set to OFF.

SELECT @@table_name_case_sensitivity;
+-------------------------------+
| @@table_name_case_sensitivity |
+-------------------------------+
|                             0 |
+-------------------------------+
1 row in set (0.04 sec)
INSERT INTO Test_Table(a) VALUES (10);
SELECT * FROM TEST_Table;

When you create a database object which is not case-sensitive, you must use a unique and case-independent name. For example, when table_name_case_sensitivity is set to OFF, running the following two commands results in an error:

CREATE TABLE test_table_2(a INT);
CREATE TABLE test_TABLE_2(a INT);

The following example illustrates that column names are not subject to case-sensitivity even when table_name_case_sensitivity is set to ON:

select @@table_name_case_sensitivity;
+-------------------------------+
| @@table_name_case_sensitivity |
+-------------------------------+
| 1 |
+-------------------------------+
CREATE TABLE test_table_3 (a int, b INT);
INSERT INTO test_table_3 (a, b) VALUES (1, 2);
SELECT a, b FROM test_table_3;
+------+------+
| a    | b    |
+------+------+
|    1 |    2 |
+------+------+
SELECT A, B FROM test_table_3;
+------+------+
| A    | B    |
+------+------+
|    1 |    2 |
+------+------+

Last modified: April 11, 2024

Was this article helpful?

Verification instructions

Note: You must install cosign to verify the authenticity of the SingleStore file.

Use the following steps to verify the authenticity of singlestoredb-server, singlestoredb-toolbox, singlestoredb-studio, and singlestore-client SingleStore files that have been downloaded.

You may perform the following steps on any computer that can run cosign, such as the main deployment host of the cluster.

  1. (Optional) Run the following command to view the associated signature files.

    curl undefined
  2. Download the signature file from the SingleStore release server.

    • Option 1: Click the Download Signature button next to the SingleStore file.

    • Option 2: Copy and paste the following URL into the address bar of your browser and save the signature file.

    • Option 3: Run the following command to download the signature file.

      curl -O undefined
  3. After the signature file has been downloaded, run the following command to verify the authenticity of the SingleStore file.

    echo -n undefined |
    cosign verify-blob --certificate-oidc-issuer https://oidc.eks.us-east-1.amazonaws.com/id/CCDCDBA1379A5596AB5B2E46DCA385BC \
    --certificate-identity https://kubernetes.io/namespaces/freya-production/serviceaccounts/job-worker \
    --bundle undefined \
    --new-bundle-format -
    Verified OK