Re: Copy Documentation - Mailing list pgsql-docs

From David G. Johnston
Subject Re: Copy Documentation
Date
Msg-id CAKFQuwbHbRMzkzCjioV-8LvtNCJnJ4H81xH4PUg7+iy_3OLhJA@mail.gmail.com
Whole thread Raw
In response to Copy Documentation  (PG Doc comments form <noreply@postgresql.org>)
List pgsql-docs


On Thursday, February 17, 2022, PG Doc comments form <noreply@postgresql.org> 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.

pgsql-docs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: maximum number of backtrace frames logged by backtrace_functions
Next
From: Fujii Masao
Date:
Subject: Re: maximum number of backtrace frames logged by backtrace_functions