suggestion: add explicit example for COPY of new-vs-old syntax

From: Assaf Gordon <agordon(at)nygenome(dot)org>
To: <pgsql-docs(at)postgresql(dot)org>
Subject: suggestion: add explicit example for COPY of new-vs-old syntax
Date: 2016-09-29 15:14:38
Message-ID: e38bee0a-9e94-b275-c404-45ce023382df@nygenome.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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.

Attachment Content-Type Size
0001-Add-new-vs-old-COPY-syntax-example-in-documentation.patch text/x-patch 1.2 KB

Browse pgsql-docs by date

  From Date Subject
Next Message atiris 2016-09-29 17:08:30 Default privileges not working
Previous Message napocoelho 2016-09-28 17:39:07 Translation to Portuguese