Skip to content

Commit aee6729

Browse files
committed
doc: Fix description of \copy for psql
The WHERE clause introduced by 31f3817 was not described. While on it, split the grammar of \copy FROM and TO into two distinct parts for clarity as they support different set of options. Author: Vignesh C Discussion: https://postgr.es/m/CALDaNm3zWr=OmxeNqOqfT=uZTSdam_j-gkX94CL8eTNfgUtf6A@mail.gmail.com Backpatch-through: 12
1 parent 6623222 commit aee6729

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

doc/src/sgml/ref/psql-ref.sgml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -983,9 +983,15 @@ testdb=>
983983
</varlistentry>
984984

985985
<varlistentry id="app-psql-meta-commands-copy">
986+
<term><literal>\copy { <replaceable class="parameter">table</replaceable> [ ( <replaceable class="parameter">column_list</replaceable> ) ] }
987+
<literal>from</literal>
988+
{ <replaceable class="parameter">'filename'</replaceable> | program <replaceable class="parameter">'command'</replaceable> | stdin | pstdin }
989+
[ [ with ] ( <replaceable class="parameter">option</replaceable> [, ...] ) ]
990+
[ where <replaceable class="parameter">condition</replaceable> ]</literal></term>
991+
986992
<term><literal>\copy { <replaceable class="parameter">table</replaceable> [ ( <replaceable class="parameter">column_list</replaceable> ) ] | ( <replaceable class="parameter">query</replaceable> ) }
987-
{ <literal>from</literal> | <literal>to</literal> }
988-
{ <replaceable class="parameter">'filename'</replaceable> | program <replaceable class="parameter">'command'</replaceable> | stdin | stdout | pstdin | pstdout }
993+
<literal>to</literal>
994+
{ <replaceable class="parameter">'filename'</replaceable> | program <replaceable class="parameter">'command'</replaceable> | stdout | pstdout }
989995
[ [ with ] ( <replaceable class="parameter">option</replaceable> [, ...] ) ]</literal></term>
990996

991997
<listitem>

0 commit comments

Comments
 (0)