Literal NUL using COPY TO

From: François Beausoleil <francois(at)teksol(dot)info>
To: Forums postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Literal NUL using COPY TO
Date: 2012-12-10 18:40:51
Message-ID: 94231212-5E0B-465F-A14E-F42CB7DEA2FA@teksol.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Can one use COPY TO stdout to output a literal NUL byte as the delimiter?

# \encoding
UTF8
# copy (select * from q limit 1) to stdout with (format csv, delimiter E'\000', header false);
ERROR: invalid byte sequence for encoding "UTF8": 0x00

# \encoding sql_ascii
# copy (select * from q limit 1) to stdout with (format csv, delimiter E'\000', header false);
ERROR: invalid byte sequence for encoding "UTF8": 0x00

The archives of this list don't seem to have anything interesting, and Google doesn't either.

Thanks!
François

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dan S 2012-12-10 19:13:08 Bug in GET STACKED DIAGNOSTICS ?
Previous Message Scott Marlowe 2012-12-10 18:35:38 Re: Problem with aborting entire transactions on error