I have a ruby on rails app in which I am querying for a boolean column, Flag. The code is:
Merchant.where(“Flag=?”,false)
However this does not work at all and the only result is that the Merchants table does not have a column name “flag”. Is there any way to fix this? The column name starts with an uppercase letter, but the search is being done for a lower case “flag”
If the column name was quoted when the table was created then you will have to quote it forever. So, if you started with this:
Then you’ll have to refer to it using
PostgreSQL normalizes all unquoted identifiers to lower case (not upper case as the standard says), that’s why the error message complains about
flagrather thanFlag.If you can, you might want to rebuild your table with only lower case column names.