Add note about case sensitivity of result of pg.escapeIdentifier (#2993)

This commit is contained in:
Jason Ford 2023-05-31 23:03:50 -07:00 committed by GitHub
parent d59cd15ed2
commit 4dbf1af069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,9 @@ const escapedIdentifier = escapeIdentifier('FooIdentifier')
console.log(escapedIdentifier) // '"FooIdentifier"'
```
<Alert>
**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.
</Alert>
### pg.escapeLiteral