3 ms·
WRT capitalization, lower-case identifiers are not actually required in PostgreSQL. The case-folding rules are: 1. unquoted identifiers are folded to lower-c
by neilc 19y ago
WRT capitalization, lower-case identifiers are not actually required in PostgreSQL. The case-folding rules are:
1. unquoted identifiers are folded to lower-case
2. double-quoted identifiers have their case preserved
This applies to all SQL queries, whether DDL or otherwise. Therefore, you can freely use mixed-case or upper-case identifiers, as long as you consistently either don't double-quote them, or always use the same case when you double-quote them.
So it is perfectly feasible to use non-lower-case identifier names, you just need to be aware of the rules. In practice, most Postgres users just use lower case identifiers all the time, but that's mostly a matter of style I think.
(FWIW, Postgres' case-folding behavior is actually one of the few areas where it is not conformant with the SQL standard.)
- e1ven 19y agoWow, thanks for the info. I'm glad to learn when I've got the wrong idea- I must have misread their forum posts on why they did it that way. When we tried using mixed case without quotes it always converted it to lowercase internally- It reminds me a bit of OS X's file system handling, in how it worked- It accepted Mixed case, it just didn't care ;) I'll look more into it, thanks. -Colin