in reply to Re: DBI/DBD::Pg changing my sql query somehow?
in thread DBI/DBD::Pg changing my sql query somehow?

PostgreSQL is case sensitive. But it auto-lowercases table and column names (among other identifiers) in statements, unless you enclose them in double-quotes "".

In this case, this leads to a mismatch. Mostly because someone unwisely created the table with mixed-case column names.

  • Comment on Re^2: DBI/DBD::Pg changing my sql query somehow?

Replies are listed 'Best First'.
Re^3: DBI/DBD::Pg changing my sql query somehow?
by parv (Parson) on Jul 25, 2024 at 08:15 UTC

    Using mixed case for column names is "unwise" if they are not quoted (as mentioned at URLs linked elsewhere in this thread). OP could get on with life with quoting them (in their queries).

Re^3: DBI/DBD::Pg changing my sql query somehow?
by hippo (Archbishop) on Jul 25, 2024 at 08:43 UTC
    Mostly because someone unwisely created the table with mixed-case column names.

    It's even worse than that. Someone created the table with column names arbitrarily scattered between camelCase and snake_case. That's just inviting doom.


    🦛