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' ] > > [ NU

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 ] 'delimit

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 Andrew Dunstan
Bruno Wolff III said: > 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 wa

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Bruno Wolff III
On Mon, Apr 12, 2004 at 08:07:12 -0400, Andrew Dunstan <[EMAIL PROTECTED]> wrote: > > Otherwise, what will happen when we try to import into some non-text field > for which '' is not a valid value? I would expect the copy to fail as it does normally. > Spreadsheets commonly represent missing v

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

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Andrew Dunstan
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 normally treats an empty string as an empty

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

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 s

[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 th

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

[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 thr

Re: [PATCHES] COPY for CSV documentation

2004-04-12 Thread Bruce Momjian
Andrew Dunstan wrote: > 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, what

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 s

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

[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

[PATCHES] win32 fixes

2004-04-12 Thread Claudio Natoli
For application to HEAD, following community review. * Most changes are to fix warnings issued when compiling win32 * removed a few redundant defines * get_user_name safe under win32 * rationalized pipe read EINTR for win32 * changed all backend instances of sleep() to pg_usleep - except for