pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Insert hex / octal literals in a query?
2+ messages / 2 participants
[nested] [flat]

* Insert hex / octal literals in a query?
@ 2019-12-12 04:07 S.Bob <sbob@quadratum-braccas.com>
  2019-12-12 14:08 ` Re: Insert hex / octal literals in a query? Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 2+ messages in thread

From: S.Bob @ 2019-12-12 04:07 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hi all;


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 ?


Thanks in advance







^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Insert hex / octal literals in a query?
  2019-12-12 04:07 Insert hex / octal literals in a query? S.Bob <sbob@quadratum-braccas.com>
@ 2019-12-12 14:08 ` Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 2+ messages in thread

From: Laurenz Albe @ 2019-12-12 14:08 UTC (permalink / raw)
  To: S.Bob <sbob@quadratum-braccas.com>; pgsql-admin@lists.postgresql.org

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






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-12-12 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-12-12 04:07 Insert hex / octal literals in a query? S.Bob <sbob@quadratum-braccas.com>
2019-12-12 14:08 ` Laurenz Albe <laurenz.albe@cybertec.at>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox