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.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-06-10 20:11:19 +0000
Seen: 12 times
Last updated: Jun 10 '23
How can the SQL debug mode be activated in PostgreSQL version 15.2?
What is the procedure for using pg_restore on Windows with Docker?
What is the equivalent of SQL Server NVARCHAR in PostgreSQL?
What is the method to retrieve the JSON data from a column in SQL?
How to solve the issue of being unable to establish a connection with libpq on Mac M1?
Is it possible to launch multiple instances of PostgreSQL using Spring Boot Testcontainers?
Due to SyntaxError, why am I unable to create a TIMESTAMP WITH TIMEZONE column in postgres?