public inbox for [email protected]
help / color / mirror / Atom feedCopy Documentation
2+ messages / 2 participants
[nested] [flat]
* Copy Documentation
@ 2022-02-18 01:19 PG Doc comments form <[email protected]>
2022-02-18 14:51 ` Re: Copy Documentation David G. Johnston <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: PG Doc comments form @ 2022-02-18 01:19 UTC (permalink / raw)
To: [email protected]; +Cc: [email protected]
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/14/sql-copy.html
Description:
The documentation states that headers are only used for CSV files, but there
is a header "PGCOPY" when using a BINARY export. e.g.
COPY (SELECT zipfile FROM file_upload) TO PROGRAM 'cat > /tmp/dunc ' (FORMAT
binary);
Please can we have an example of using COPY (server/plpgsql) to copy a bytea
(eg image) column to an image file, unchanged - i.e. no headers.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Copy Documentation
2022-02-18 01:19 Copy Documentation PG Doc comments form <[email protected]>
@ 2022-02-18 14:51 ` David G. Johnston <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: David G. Johnston @ 2022-02-18 14:51 UTC (permalink / raw)
To: [email protected] <[email protected]>; [email protected] <[email protected]>
On Thursday, February 17, 2022, PG Doc comments form <[email protected]>
wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/14/sql-copy.html
> Description:
>
> The documentation states that headers are only used for CSV files, but
> there
> is a header "PGCOPY" when using a BINARY export. e.g.
> COPY (SELECT zipfile FROM file_upload) TO PROGRAM 'cat > /tmp/dunc '
> (FORMAT
> binary);
> Please can we have an example of using COPY (server/plpgsql) to copy a
> bytea
> (eg image) column to an image file, unchanged - i.e. no headers.
>
To my knowledge there is no such example possible. If you want to export
the contents of a bytea to a file you need to do so using client-side code,
pulling the data from a normal resultset. This includes using an untrusted
language function.
David J.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2022-02-18 14:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-02-18 01:19 Copy Documentation PG Doc comments form <[email protected]>
2022-02-18 14:51 ` David G. Johnston <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox