Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
a51e54cf
Commit
a51e54cf
authored
20 years ago
by
Neil Conway
Browse files
Options
Downloads
Patches
Plain Diff
Document a limitation of COPY's new CSV mode. Doc patch from Andrew
Dunstan, editorializing by Neil Conway.
parent
b25d23e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/ref/copy.sgml
+19
-13
19 additions, 13 deletions
doc/src/sgml/ref/copy.sgml
with
19 additions
and
13 deletions
doc/src/sgml/ref/copy.sgml
+
19
−
13
View file @
a51e54cf
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/copy.sgml,v 1.5
8
2004/11/1
5
0
6:32:15
neilc Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/copy.sgml,v 1.5
9
2004/11/1
7
0
2:50:06
neilc Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
...
@@ -433,13 +433,13 @@ COPY <replaceable class="parameter">tablename</replaceable> [ ( <replaceable cla
...
@@ -433,13 +433,13 @@ COPY <replaceable class="parameter">tablename</replaceable> [ ( <replaceable cla
</para>
</para>
<para>
<para>
It is strongly recommended that applications generating
COPY
data convert
It is strongly recommended that applications generating
<command>COPY</command>
data convert
data newlines and carriage returns to the <literal>\n</> and
data newlines and carriage returns to the <literal>\n</> and
<literal>\r</> sequences respectively. At present it is
<literal>\r</> sequences respectively. At present it is
possible to represent a data carriage return by a backslash and carriage
possible to represent a data carriage return by a backslash and carriage
return, and to represent a data newline by a backslash and newline.
return, and to represent a data newline by a backslash and newline.
However, these representations might not be accepted in future releases.
However, these representations might not be accepted in future releases.
They are also highly vulnerable to corruption if the
COPY
file is
They are also highly vulnerable to corruption if the
<command>COPY</command>
file is
transferred across different machines (for example, from Unix to Windows
transferred across different machines (for example, from Unix to Windows
or vice versa).
or vice versa).
</para>
</para>
...
@@ -484,15 +484,16 @@ COPY <replaceable class="parameter">tablename</replaceable> [ ( <replaceable cla
...
@@ -484,15 +484,16 @@ COPY <replaceable class="parameter">tablename</replaceable> [ ( <replaceable cla
<para>
<para>
In general, the <literal>CSV</> format has no way to distinguish a
In general, the <literal>CSV</> format has no way to distinguish a
<literal>NULL</> from an empty string.
<literal>NULL</> value from an empty string.
<productname>PostgreSQL</productname>'s COPY handles this by
<productname>PostgreSQL</>'s <command>COPY</> handles this by
quoting. A <literal>NULL</> is output as the <literal>NULL</> string
quoting. A <literal>NULL</> is output as the <literal>NULL</>
and is not quoted, while a data value matching the <literal>NULL</> string
string and is not quoted, while a data value matching the
is quoted. Therefore, using the default settings, a <literal>NULL</> is
<literal>NULL</> string is quoted. Therefore, using the default
written as an unquoted empty string, while an empty string is
settings, a <literal>NULL</> is written as an unquoted empty
written with double quotes (<literal>""</>). Reading values follows
string, while an empty string is written with double quotes
similar rules. You can use <literal>FORCE NOT NULL</> to prevent <literal>NULL</>
(<literal>""</>). Reading values follows similar rules. You can
input comparisons for specific columns.
use <literal>FORCE NOT NULL</> to prevent <literal>NULL</> input
comparisons for specific columns.
</para>
</para>
<note>
<note>
...
@@ -500,7 +501,12 @@ COPY <replaceable class="parameter">tablename</replaceable> [ ( <replaceable cla
...
@@ -500,7 +501,12 @@ COPY <replaceable class="parameter">tablename</replaceable> [ ( <replaceable cla
CSV mode will both recognize and produce CSV files with quoted
CSV mode will both recognize and produce CSV files with quoted
values containing embedded carriage returns and line feeds. Thus
values containing embedded carriage returns and line feeds. Thus
the files are not strictly one line per table row like text-mode
the files are not strictly one line per table row like text-mode
files.
files. However, <productname>PostgreSQL</productname> will reject
<command>COPY</command> input if any fields contain embedded line
end character sequences that do not match the line ending
convention used in the CSV file itself. It is generally safer to
import data containing embedded line end characters using the
text or binary formats rather than CSV.
</para>
</para>
</note>
</note>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment