From: Assaf Gordon <agordon@nygenome.org>
To: pgsql-docs@postgresql.org
Subject: suggestion: add explicit example for COPY of new-vs-old syntax
Date: Thu, 29 Sep 2016 11:14:38 -0400
Message-ID: <e38bee0a-9e94-b275-c404-45ce023382df@nygenome.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-docs>
Hello,
I'd like to suggest the following small patch (attached),
to give explicit example for COPY of new-vs-old syntax at the top of the page.
===
Starting with PostgreSQL version 9.0, the
COPY commands supports new syntax with parenthesis
and commas. The old syntax is still supported, see details
at the bottom of this page.
New syntax:
COPY country TO STDOUT (FORMAT CSV, NULL 'NA', HEADER ON);
Old syntax:
COPY country TO STDOUT NULL 'NA' CSV HEADER;
===
The web is full of examples, but many of them are for the old syntax.
The COPY documentation page mentions this critical difference only in passing,
and requires careful reading of the entire page to spot the culprit of syntax errors.
A typical example is:
https://www.postgresql.org/message-id/26320.1291391510%40sss.pgh.pa.us
I know examples usually go at the end of the page,
but I think in this case, a short example is worth at least 100 words :)
Comments (and rephrasing) are welcomed,
regards,
- assaf
This electronic message is intended for the use of the named recipient only, and may contain information that is confidential, privileged or protected from disclosure under applicable law. If you are not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any reading, disclosure, dissemination, distribution, copying or use of the contents of this message including any of its attachments is strictly prohibited. If you have received this message in error or are not the named recipient, please notify us immediately by contacting the sender at the electronic mail address noted above, and destroy all copies of this message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
Attachments:
0001-Add-new-vs-old-COPY-syntax-example-in-documentation.patch (text/x-patch, 0B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-docs@postgresql.org
Cc: agordon@nygenome.org
Subject: Re: suggestion: add explicit example for COPY of new-vs-old syntax
In-Reply-To: <e38bee0a-9e94-b275-c404-45ce023382df@nygenome.org>
References: <e38bee0a-9e94-b275-c404-45ce023382df@nygenome.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox