Select with if statement return 'column does not exist' Database, application.
PostgreSQL 11.4 (Ubuntu 11.4-1.pgdg19.04+1),
Dbeaver 6.1.1.

What I need?
Return right values.

What I do.
Here is part of code.

select
if(available_count &lt; 5, "neni skladem", "na sklade") as availability
from
...


Return this.

SQL Error [42703]: ERROR: column "neni skladem" does not exist


Where is the catch?

Thanks.
You have two errors in your statement: 


There is no IF in SQL, you need to use a CASE expression
String constants are defined using single quotes in SQL ('), double quotes are for identifiers


select case 
          when available_count &lt; 5 then 'neni skladem'
          else 'na sklade'
       end as availability
from ...