0

I am running the query SELECT * FROM app_user WHERE login_id = "john"; and getting -

ERROR:  column "john" does not exist
LINE 1: SELECT * FROM public.app_user WHERE login_id = "john";
                                                       ^
SQL state: 42703
Character: 48

I have also tried SELECT * FROM public.app_user WHERE login_id = "john"; and I still get the same error.

The same error also occurs with any other column but the id column(id is the only non-VARCHAR column and is the primary key).

So, SELECT * FROM app_user WHERE id = 5; is working as expected .

A snapshot of the table follows.

Snapshot of the table

sam
  • 95
  • 7

1 Answers1

1

If you write the string in double quotes, postgres will interpret it as a column name in the WHERE clause, just use single quotes:

SELECT * FROM public.app_user WHERE login_id = 'john';
Bruno Carballo
  • 1,156
  • 8
  • 15