Re: Insert hex / octal literals in a query?

Laurenz Albe <[email protected]> Thu, 12 Dec 2019 15:08:16 +0100
Newsgroups gmane.comp.db.postgresql.admin
Message-ID <[email protected]>
On Wed, 2019-12-11 at 21:07 -0700, S.Bob wrote:
> we have a client that needs us to pull data via sql and stage it in a 
> file with odd hex / octal characters as the field delimiter (Hex 1F or 
> Oct 31)
> 
> Is there an easy way to do this ?

No problem:

COPY uni TO ... (FORMAT 'csv', DELIMITER E'\u001F')

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com