Commit 8492d863 authored by Stephen Frost's avatar Stephen Frost

Correct stdin/stdout usage in COPY .. PROGRAM

The COPY documentation incorrectly stated, for the PROGRAM case,
that we read from stdin and wrote to stdout.  Fix that, and improve
consistency by referring to the 'PostgreSQL' user instead of the
'postgres' user, as is done in the rest of the COPY documentation.

Pointed out by Peter van Dijk.

Back-patch to 9.3 where COPY .. PROGRAM was introduced.
parent fd02931a
...@@ -71,12 +71,14 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable ...@@ -71,12 +71,14 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
<para> <para>
<command>COPY</command> with a file name instructs the <command>COPY</command> with a file name instructs the
<productname>PostgreSQL</productname> server to directly read from <productname>PostgreSQL</productname> server to directly read from
or write to a file. The file must be accessible to the server and or write to a file. The file must be accessible by the
the name must be specified from the viewpoint of the server. When <productname>PostgreSQL</productname> user (the user ID the server
<literal>PROGRAM</literal> is specified, the server executes the runs as) and the name must be specified from the viewpoint of the
given command, and reads from its standard input, or writes to its server. When <literal>PROGRAM</literal> is specified, the server
standard output. The command must be specified from the viewpoint of the executes the given command and reads from the standard output of the
server, and be executable by the <literal>postgres</> user. When program, or writes to the standard input of the program. The command
must be specified from the viewpoint of the server, and be executable
by the <productname>PostgreSQL</productname> user. When
<literal>STDIN</literal> or <literal>STDOUT</literal> is <literal>STDIN</literal> or <literal>STDOUT</literal> is
specified, data is transmitted via the connection between the specified, data is transmitted via the connection between the
client and the server. client and the server.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment