Re: COPY syntax improvement - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: COPY syntax improvement
Date
Msg-id 200206200243.g5K2hKG15850@candle.pha.pa.us
Whole thread Raw
In response to Re: COPY syntax improvement  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: COPY syntax improvement  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut wrote:
> Bruce Momjian writes:
> 
> >     COPY table
> >         FROM { 'filename' | stdin }
> >         [ [ WITH ]
> >               [ BINARY ]
> >               [ OIDS ]
> >               [ DELIMITER 'delimiter' ]
> >               [ NULL AS 'null string' ] ]
> 
> I'm not sure what was wrong with the old syntax except for fixing the
> DELIMITER plural.  For example, the current
> 
>     copy mytable with oids from stdin using delimiter '|';
> 
> reads very pleasantly, but
> 
>     copy mytable from stdin with oids delimiter '|';
> 
> isn't nearly as good.  (E.g., it's not the oids' delimiter, and it's not
> *with* delimiter because you don't actually copy the delimiter, you just
> use it.)

I thought there were complaints that the old COPY syntax just had too
many features stuffed in too many unusual places, e.g. delimiter after
filename, oids after tablename, binary after COPY, NULL after
delimiter.  It was just too weird.  Now, all the options can be
specified after WITH, like the other SQL commands.

However, the old syntax still works.

--  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: Ryan Mahoney
Date:
Subject: Re: count and group by question
Next
From: Bruce Momjian
Date:
Subject: Re: COPY syntax improvement