COPY syntax improvement

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: COPY syntax improvement
Date: 2002-06-19 06:13:37
Message-ID: 200206190613.g5J6Db215780@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.)

For portability, it still supports the old syntax of BINARY after COPY,
WITH OIDS after 'table' and USING DELIMITERS after 'filename'. I have
sent the patch to the patches list.

I have not modified pg_dump so that 7.3 dumps can be loaded into <=7.2
databases. I have modified psql \copy to _only_ use the new syntax, and
to only send the new syntax to the backends. (We don't usually support
new psql in to older databases anyway.) Not sure if I should document
the old syntax somewhere because pg_dump uses WITH OIDS with the old
syntax.

I have not applied the patch. I am waiting for comments.

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-06-19 06:14:34 Re: pgsql/src/backend/parser gram.y
Previous Message Bruce Momjian 2002-06-19 05:55:08 Re: pgsql/src/backend/parser gram.y