#5205·postgrest

Selecting string literals in PostgREST query

Author: taimoorzaeemCreated Sep 1, 2026Updated Sep 1, 2026
Labelsdocsquery-grammar

Background

Someone reached out to me privately to ask this. I am opening this for public discussion.

Problem

They said:

I just a have a quick question that has probably been mentioned in the docs but for the life in me I cannot find it.

How do I deal with hardcoded values, like if I want to select something from a table and then add a hardcoded value to it, in postgresql I would do it as:

SELECT somecolumn, 'hardcodedvalue' as hardcodedname FROM sometable

where I would another column (or key as json) with the value of 'hardcodedvalue' and key hardcodedname.

I tried with something like this sometable?select=somecolumn,hardcodedname:'hardcodedvalue' but that obviously didnt work.