Re: COPY syntax improvement - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: COPY syntax improvement
Date
Msg-id 200206191739.g5JHdKc23443@candle.pha.pa.us
Whole thread Raw
In response to COPY syntax improvement  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian wrote:
> I am working on the TODO item:
> 
>     o Change syntax to WITH DELIMITER, (keep old syntax around?)
> 
> and I have added syntax so COPY can now accept all parameters at the end
> using WITH:
> 
>     COPY table
>         FROM { 'filename' | stdin }
>         [ [ WITH ] 
>               [ BINARY ] 
>               [ OIDS ]
>               [ DELIMITER 'delimiter' ]
>               [ NULL AS 'null string' ] ]
> 
> (COPY TO is similar.)

Actually, in looking at the grammar, I see no reason NULL should have AS
while DELIMITER does not.  New syntax has AS optional for both:
COPY table    FROM { 'filename' | stdin }    [ [ WITH ]           [ BINARY ]           [ OIDS ]          [ DELIMITER [
AS] 'delimiter' ]          [ NULL [ AS ] 'null string' ] ]
 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ecpg and bison again
Next
From:
Date:
Subject: count and group by question