Обсуждение: Insert hex / octal literals in a query?

Поиск
Список
Период
Сортировка

Insert hex / octal literals in a query?

От
"S.Bob"
Дата:
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





Re: Insert hex / octal literals in a query?

От
Laurenz Albe
Дата:
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