1

Is there any flag or option that can be set to disable Postgres from lowering query casing? (ie SELECT firstName, lastName, ... is converted by Postgres to SELECT firstname, lastname, ... )

Yes, I already know if you use double quotes, it will preserve case. And I know because of this annoying behavior, most recommend not to use case sensitive columns, forcing users to only use something other than Pascal naming schemes like snake naming schemes. I don't get why this behavior was built-in the first place.

SILENT
  • 3,916
  • 3
  • 38
  • 57

1 Answers1

2

SQL identifiers must be case-insensitive, unless quoted, according to the standard. So, no, you cannot change this behaviour (unless you're willing to modify Postgres source code and render it even less standard-compliant than it already is).

See also this Q&A

mustaccio
  • 18,234
  • 16
  • 48
  • 57
  • Do you know why changing case 'feature' is a standard? Also, I believe the standard was to make it uppercase, not lowercase. – SILENT Apr 02 '20 at 17:17
  • 1
    I can only speculate, but at the time the SQL language was first defined (as SEQUEL), for use on mainframes, many terminals didn't even have a way to represent lowercase letters, and all programming languages were case-insensitive. See also [this](https://stackoverflow.com/questions/13409094/why-does-postgresql-default-everything-to-lower-case) – mustaccio Apr 02 '20 at 17:28
  • 1
    @SILENT: yes you are right, the standard requires folding to uppercase. –  Apr 02 '20 at 18:35