Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Andrew Dunstan
Tom Lane said: COPY a FROM stdin WITH DELIMITER , QUOTE '' EQUOTE ''; EQUOTE for embedded quote. ESCAPE would be better no? It's already a keyword ... much better. BTW, don't forget that the syntax options have to be provided in psql's \copy as well. Did the patch cover that? No,

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Andrew Dunstan
Bruce Momjian said: COPY tablename [ ( column [, ...] ) ] TO { 'filename' | STDOUT } [ [ WITH ] [ BINARY ] [ OIDS ] [ DELIMITER [ AS ] 'delimiter' ] [ NULL [ AS ] 'null string' ] ] [

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Bruce Momjian
Andrew Dunstan wrote: Bruce Momjian said: COPY tablename [ ( column [, ...] ) ] TO { 'filename' | STDOUT } [ [ WITH ] [ BINARY ] [ OIDS ] [ DELIMITER [ AS ] 'delimiter' ] [ NULL [ AS ] 'null

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Andrew Dunstan
Bruce Momjian said: Andrew Dunstan wrote: Bruce Momjian said: COPY tablename [ ( column [, ...] ) ] TO { 'filename' | STDOUT } [ [ WITH ] [ BINARY ] [ OIDS ] [ DELIMITER [ AS ] 'delimiter' ]

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Bruno Wolff III
On Mon, Apr 12, 2004 at 02:26:14 -0400, Andrew Dunstan [EMAIL PROTECTED] wrote: a few points: . in CSV mode, NULL should default to '' - that was in what I sent in. Postgres normally treats an empty string as an empty string. Are you sure you really want it to be treated as a NULL by

Re: [PATCHES] pg_restore ignore error patch

2004-04-12 Thread Fabien COELHO
Dear Andrew, I transfer some data from one server to the other. On such occasion, I use my laptop to connect with server X, I download the data, then I restore them to server Y. The versions on my laptop and both servers are likely to be different. My laptop is likely to have some

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Tom Lane
Bruno Wolff III [EMAIL PROTECTED] writes: On Mon, Apr 12, 2004 at 02:26:14 -0400, Andrew Dunstan [EMAIL PROTECTED] wrote: a few points: . in CSV mode, NULL should default to '' - that was in what I sent in. Postgres normally treats an empty string as an empty string. Are you sure you

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Bruce Momjian
Andrew Dunstan wrote: Tom Lane wrote: Bruno Wolff III [EMAIL PROTECTED] writes: On Mon, Apr 12, 2004 at 02:26:14 -0400, Andrew Dunstan [EMAIL PROTECTED] wrote: a few points: . in CSV mode, NULL should default to '' - that was in what I sent in. Postgres

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Bruno Wolff III
On Mon, Apr 12, 2004 at 10:30:22 -0400, Bruce Momjian [EMAIL PROTECTED] wrote: It is my understanding that \N is a valid column value (no backslash escape in CSV, right?), so we can't use it for NULL. The only thing I can think of is for NULL to be: ,, (no quotes) and a

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Bruce Momjian
Bruno Wolff III wrote: On Mon, Apr 12, 2004 at 10:30:22 -0400, Bruce Momjian [EMAIL PROTECTED] wrote: It is my understanding that \N is a valid column value (no backslash escape in CSV, right?), so we can't use it for NULL. The only thing I can think of is for NULL to be: ,,

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Andrew Dunstan
Bruce Momjian wrote: It is my understanding that \N is a valid column value (no backslash escape in CSV, right?), so we can't use it for NULL. \ is not conventionally magical in CSVs in the general case. That doesn't mean we couldn't use \N, but to me it would violate the principle of least

[PATCHES] aclitem accessor functions

2004-04-12 Thread Fabien COELHO
Dear patchers, Please find a attached a small patch that adds accessor functions for aclitem so that it is not an opaque datatype. I needed these functions to browse aclitems from user land. I can load them when necessary, but it seems to me that these accessors for a backend type belong to the

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Bruce Momjian
Andrew Dunstan wrote: In fact, in the patch I sent in, no quoted string is marked as null when being read (so even if you use \N as the null marker, \N will be that literal and not a null marker). And the null marker, whatever it is, should be made quote safe by us throwing an error if it

[PATCHES] change for stdin/stdout for \copy

2004-04-12 Thread Bruce Momjian
I have applied the following patch: --- Change psql \copy stdin/stdout to read from command input/output. Add pstdin/pstdout to read from psql's stdin/stdout. BACKWARD INCOMPATIBLE CHANGE -- Bruce Momjian

Re: [PATCHES] New socket code for win32

2004-04-12 Thread Bruce Momjian
Patch applied with later socket.c file used. Thanks. This is a major Win32 accomplishment. --- Magnus Hagander wrote: Here's an attempt at new socket and signal code for win32. It works on the principle of turning

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Andrew Dunstan
Bruce Momjian wrote: Andrew Dunstan wrote: In fact, in the patch I sent in, no quoted string is marked as null when being read (so even if you use \N as the null marker, \N will be that literal and not a null marker). And the null marker, whatever it is, should be made quote safe by us

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Bruce Momjian
FYI, this CVS is turning into quite a job, but doing it right takes this kind of effort. --- Andrew Dunstan wrote: Bruce Momjian wrote: Andrew Dunstan wrote: In fact, in the patch I sent in, no quoted string is

Re: [PATCHES] aclitem accessor functions

2004-04-12 Thread Peter Eisentraut
Fabien COELHO wrote: Please find a attached a small patch that adds accessor functions for aclitem so that it is not an opaque datatype. I needed these functions to browse aclitems from user land. I can load them when necessary, but it seems to me that these accessors for a backend type

[PATCHES] Updated COPY CSV patch

2004-04-12 Thread Bruce Momjian
Andrew Dunstan wrote: If the null marker is not an empty string, it gets an error, of course - if it is it gets a null: [EMAIL PROTECTED] pginst]$ echo ',,' | bin/psql -c create temp table foo (a int, b text, c text); copy foo from stdin delimiter ',\' null 'N'; ERROR: invalid input