Remove double quotes from the return of a function in PostgreSQL Remove double quotes from the return of a function in PostgreSQL json json

Remove double quotes from the return of a function in PostgreSQL


The -> operator returns a json result. Casting it to text leaves it in a json reprsentation.

The ->> operator returns a text result. Use that instead.

test=> SELECT '{"car": "going"}'::jsonb -> 'car'; ?column? ---------- "going"(1 row)test=> SELECT '{"car": "going"}'::jsonb ->> 'car'; ?column? ---------- going(1 row)