git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5a261c1)
doc: Add example file for COPY
2025年7月16日 22:21:18 +0000 (00:21 +0200)
2025年7月16日 22:21:18 +0000 (00:21 +0200)
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


diff --git a/doc/src/sgml/query.sgml b/doc/src/sgml/query.sgml
index a864d146f02b81940a16598ce86e4a0b990a4aa6..7024c26fad768916451da70203a69949f04fb130 100644 (file)
--- a/doc/src/sgml/query.sgml
+++ b/doc/src/sgml/query.sgml
@@ -264,8 +264,18 @@ COPY weather FROM '/home/user/weather.txt';
where the file name for the source file must be available on the
machine running the backend process, not the client, since the backend process
- reads the file directly. You can read more about the
- <command>COPY</command> command in <xref linkend="sql-copy"/>.
+ reads the file directly. The data inserted above into the weather table
+ could also be inserted from a file containing (values are separated by a
+ tab character):
+
+<programlisting>
+San Francisco 46 50 0.25 1994年11月27日
+San Francisco 43 57 0.0 1994年11月29日
+Hayward 37 54 \N 1994年11月29日
+</programlisting>
+
+ You can read more about the <command>COPY</command> command in
+ <xref linkend="sql-copy"/>.
</para>
</sect1>
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /