From 4dbf1af06976ed6ea4f4c09b9caf620396be2de1 Mon Sep 17 00:00:00 2001 From: Jason Ford Date: Wed, 31 May 2023 23:03:50 -0700 Subject: [PATCH] Add note about case sensitivity of result of pg.escapeIdentifier (#2993) --- docs/pages/apis/utilities.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/pages/apis/utilities.mdx b/docs/pages/apis/utilities.mdx index d3371808..921cba8e 100644 --- a/docs/pages/apis/utilities.mdx +++ b/docs/pages/apis/utilities.mdx @@ -14,6 +14,9 @@ const escapedIdentifier = escapeIdentifier('FooIdentifier') console.log(escapedIdentifier) // '"FooIdentifier"' ``` + + **Note**: When using an identifier that is the result of this function in an operation like `CREATE TABLE ${escapedIdentifier(identifier)}`, the table that is created will be CASE SENSITIVE. If you use any capital letters in the escaped identifier, you must always refer to the created table like `SELECT * from "MyCaseSensitiveTable"`; queries like `SELECT * FROM MyCaseSensitiveTable` will result in a "Non-existent table" error since case information is stripped from the query. + ### pg.escapeLiteral