Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This could be due to changes in the handling of special characters or the way the new version of PostgreSQL escapes certain characters in JSONB data. It is recommended to check the documentation of the new version for any changes in this regard and adjust the query accordingly.

One way to remove the double quotes in the result of the select statement for JSONB type is to use the ->> operator instead of the -> operator. For example,

SELECT column_name->>'key_name' FROM table_name;

This will return the value of the key without the double quotes. Alternatively, you can use the jsonb_build_object function to build the JSON object and return the string representation without the double quotes. For example,

SELECT jsonb_build_object('key_name', column_name->>'key_name')::text FROM table_name;

This will return the value of the key as a string without the double quotes.