pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: S.Bob <sbob@quadratum-braccas.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Insert hex / octal literals in a query?
Date: Thu, 12 Dec 2019 15:08:16 +0100
Message-ID: <ba3af552cda95682da98417574e7c7df4554ae31.camel@cybertec.at> (raw)
In-Reply-To: <676b031e-ac08-36f4-8253-c5cb266404d7@quadratum-braccas.com>
References: <676b031e-ac08-36f4-8253-c5cb266404d7@quadratum-braccas.com>

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






view thread (2+ messages)

Message-ID: <ba3af552cda95682da98417574e7c7df4554ae31.camel@cybertec.at>
Permalink:  ../ba3af552cda95682da98417574e7c7df4554ae31.camel@cybertec.at/
Also on:    postgresql.org/message-id/ba3af552cda95682da98417574e7c7df4554ae31.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, sbob@quadratum-braccas.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Insert hex / octal literals in a query?
  In-Reply-To: <ba3af552cda95682da98417574e7c7df4554ae31.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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