COPY CSV keywords

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: COPY CSV keywords
Date: 2004-04-20 13:22:00
Message-ID: 200404201322.i3KDM0a04241@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


[ 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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-04-20 13:39:58 Re: CSV patch applied
Previous Message Karel Zak 2004-04-20 13:15:00 Re: pg_encoding not needed anymore

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2004-04-20 13:39:58 Re: CSV patch applied
Previous Message Bruce Momjian 2004-04-20 12:58:26 Re: pg_restore ignore error patch