Re: JSON_VALUE() behavior when RETURNING bytea (expected base64 decoding) - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Re: JSON_VALUE() behavior when RETURNING bytea (expected base64 decoding)
Date
Msg-id CAKAnmmLPhU=fucw8B-TUs44+64R17LZ1eDN8qKORR+dTJVj77w@mail.gmail.com
Whole thread Raw
In response to JSON_VALUE() behavior when RETURNING bytea (expected base64 decoding)  (Shay Rojansky <roji@roji.org>)
List pgsql-hackers
It looks like your bytea_output is set to 'escape', which would explain what you are seeing. Try adding this in first:

SET bytea_output = hex;
SELECT JSON_VALUE(jsonb '"AQID"', '$' RETURNING bytea);

That (hex) is the default value, so you must be setting it to escape somewhere. You can see where by running:

select * from pg_settings where name = 'bytea_output';

Examine the source, sourcefile, and sourceline columns 

I personally prefer hex, but perhaps it's set to octet in your system for a reason. If not, maybe change it globally?

Cheers,
Greg

--
Enterprise Postgres Software Products & Tech Support

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Interrupts vs signals
Next
From: Shay Rojansky
Date:
Subject: Re: JSON_VALUE() behavior when RETURNING bytea (expected base64 decoding)