v3-0001-doc-Add-example-file-for-COPY.patch
application/octet-stream
Filename: v3-0001-doc-Add-example-file-for-COPY.patch
Type: application/octet-stream
Part: 0
Message:
Re: Missing File weather.txt
Patch
Format: format-patch
Series: patch v3-0001
Subject: doc: Add example file for COPY
| File | + | − |
|---|---|---|
| doc/src/sgml/query.sgml | 12 | 2 |
From 15f04b455d053087614dfeb9c381143066267057 Mon Sep 17 00:00:00 2001
From: Daniel Gustafsson <dgustafsson@postgresql.org>
Date: Fri, 11 Jul 2025 00:03:57 +0200
Subject: [PATCH v3] 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>
Reported-by: davidhowes@gmail.com
Discussion: https://postgr.es/m/158017814191.19852.15019251381150731439@wrigleys.postgresql.org
Backpatch-through: 13
---
doc/src/sgml/query.sgml | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/doc/src/sgml/query.sgml b/doc/src/sgml/query.sgml
index 727a0cb185f..002d2f89fb4 100644
--- 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 (note that the white space
+ on each line is actually 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>
--
2.39.3 (Apple Git-146)