Skip to content

Commit afd2547

Browse files
doc: Add example file for COPY
The paragraph for introducing INSERT and COPY discussed how a file could be used for bulk loading with COPY, without actually showing what the file would look like. This adds a programlisting for the file contents. Backpatch to all supported branches since this example has lacked the file contents since PostgreSQL 7.2. Author: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Fujii Masao <masao.fujii@oss.nttdata.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/158017814191.19852.15019251381150731439@wrigleys.postgresql.org Backpatch-through: 13
1 parent 57949ce commit afd2547

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

doc/src/sgml/query.sgml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,18 @@ COPY weather FROM '/home/user/weather.txt';
264264

265265
where the file name for the source file must be available on the
266266
machine running the backend process, not the client, since the backend process
267-
reads the file directly. You can read more about the
268-
<command>COPY</command> command in <xref linkend="sql-copy"/>.
267+
reads the file directly. The data inserted above into the weather table
268+
could also be inserted from a file containing (values are separated by a
269+
tab character):
270+
271+
<programlisting>
272+
San Francisco 46 50 0.25 1994-11-27
273+
San Francisco 43 57 0.0 1994-11-29
274+
Hayward 37 54 \N 1994-11-29
275+
</programlisting>
276+
277+
You can read more about the <command>COPY</command> command in
278+
<xref linkend="sql-copy"/>.
269279
</para>
270280
</sect1>
271281

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy