Re: raw output from copy - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: raw output from copy
Date
Msg-id CAFj8pRD2BY-gkbUBsGF=WYb_tCVPTiBZe35VCoJX8EXF0Qh1Ng@mail.gmail.com
Whole thread
In response to Re: raw output from copy  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers

It would be nice, but it is not true. You can get correct non utf8 xml with encoding specification only when binary mode is used. Psql doesn't support binary mode.

Regards

Pavel

Dne 15. 4. 2015 22:06 napsal uživatel "Peter Eisentraut" <peter_e@gmx.net>:
On 4/10/15 5:26 PM, Pavel Stehule wrote:
> Hi
>
> I wrote a prototype of this patch, and it works well
>
> postgres=# set client_encoding to 'latin2';
> SET
> Time: 1.488 ms
> postgres=# \copy (select xmlelement(name xx, d) from d) to ~/d.xml
> (format 'raw')
> COPY 1
> Time: 1.108 ms
> postgres=# copy (select xmlelement(name xx, d) from d) to stdout (format
> 'raw') ;
> <?xml version="1.0" encoding="LATIN2"?><xx>příliš žluťoučký
> kůň</xx>Time: 1.000 ms

I think you can get the same thing using regular psql output and just
turning off all field and record separators and tuple headers and so on.

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Turning off HOT/Cleanup sometimes
Next
From: Alvaro Herrera
Date:
Subject: show xl_prev in xlog.c errcontext