Thread: Question about weird COPY syntax

Question about weird COPY syntax

From
Evan Carroll
Date:
Why is it that "DELIMITER", and "NULL" options are under [WITH] but
not under [CSV]. This seems at least slightly awkward.

Command:     COPY
Description: copy data between a file and a table
Syntax:
COPY tablename [ ( column [, ...] ) ]
    FROM { 'filename' | STDIN }
    [ [ WITH ]
          [ BINARY ]
          [ OIDS ]
          [ DELIMITER [ AS ] 'delimiter' ]
          [ NULL [ AS ] 'null string' ]
          [ CSV [ HEADER ]                                        <-
Why not put them under this.
                [ QUOTE [ AS ] 'quote' ]
                [ ESCAPE [ AS ] 'escape' ]
                [ FORCE NOT NULL column [, ...] ]

--
Evan Carroll
System Lord of the Internets
http://www.evancarroll.com

Re: Question about weird COPY syntax

From
Tom Lane
Date:
Evan Carroll <me@evancarroll.com> writes:
> Why is it that "DELIMITER", and "NULL" options are under [WITH] but
> not under [CSV]. This seems at least slightly awkward.

They're not specific to CSV.

            regards, tom lane