Re: Insert hex / octal literals in a query?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: "S(dot)Bob" <sbob(at)quadratum-braccas(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Insert hex / octal literals in a query?
Date: 2019-12-12 14:08:16
Message-ID: ba3af552cda95682da98417574e7c7df4554ae31.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message S.Bob 2019-12-12 20:02:42 Parse / print all elements of a json data column -
Previous Message Shrikant Bhende 2019-12-12 07:00:59 Re: Slow running query