COPY CSV keywords - Mailing list pgsql-hackers

From Bruce Momjian
Subject COPY CSV keywords
Date
Msg-id 200404201322.i3KDM0a04241@candle.pha.pa.us
Whole thread Raw
Responses Re: COPY CSV keywords  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: COPY CSV keywords  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
[ discussion moved to hackers.]

Peter Eisentraut wrote:
> Bruce Momjian wrote:
> > I have applied the attached patch that complete TODO item:
> >
> >         o -Allow dump/load of CSV format
> >
> > This adds new keywords to COPY and \copy:
> >
> >         CSV - enable CSV mode
> >         QUOTE - specify quote character
> >         ESCAPE - specify escape character
> >         FORCE - force quoting of specified columns
> 
> FORCE QUOTE
> 
> >         LITERAL - prevent NULL checks for specific columns
> 
> NO NULL CHECK

I considered going this direction, but it broke the WITH clause style of
COPY.  Previously it was "WITH keyword value".  Now it is also "WITH
keyword value, value" too.  This would add "WITH keyword keyword value,
value".

It would change:COPY pg_language TO '/tmp/x' WITH CSV FORCE lanname     LITERAL lanacl
to:COPY pg_language TO '/tmp/x' WITH CSV FORCE QUOTE lanname NO    NULL CHECK lanacl

If folks like it, I can make the change.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Karel Zak
Date:
Subject: Re: pg_encoding not needed anymore
Next
From: Andrew Dunstan
Date:
Subject: Re: pg_encoding not needed anymore