0

I am trying to query a table using where clause in Postgres 12

case 1

SELECT * 
FROM schema.e_employee_table 
WHERE FK_EMPLOYEE=100;

so when i query the above query i get "FK_EMPLOYEE" column is missing.

case2:

SELECT * 
FROM schema.e_employee_table 
WHERE "FK_EMPLOYEE"=100;

when i query the above one i got the query results

So can someone explain do we need to put our column name inside "",is it the syntax. If so where it is mentioned in the official documentation.

And I can also see the column name we are mentioning is case sensitive.

  • Postgres just doesn't like columns with upper-case in their names. If you can avoid it your life will be a lot easier. For what it's worth, 1980s style SCREAM CASE is basically super annoying if used for column and table names. – tadman Apr 15 '21 at 06:14
  • 1
    Relevant section in the manual: https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS You also might wan to read this: https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_upper_case_table_or_column_names –  Apr 15 '21 at 06:15

0 Answers0