Skip site navigation (1) Skip section navigation (2)

Re: [PATCHES] BUG #2221: Bad delimiters allowed in COPY ...

From: David Fetter <david(at)fetter(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, pgsql-bugs(at)postgresql(dot)org,PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [PATCHES] BUG #2221: Bad delimiters allowed in COPY ...
Date: 2006-02-01 02:48:10
Message-ID: 20060201024810.GB7231@fetter.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
On Tue, Jan 31, 2006 at 08:03:41PM -0500, Bruce Momjian wrote:
> Uh, couldn't the delimiter be a backslash in CVS mode?

I don't think so.  Folks?

Anyhow, if there are different sets, I could do something like:

#define BADCHARS "\r\n\\"
#define BADCHARS_CSV "\r\n"

and then check for csv_mode, etc.

> 	+ #define BADCHARS "\r\n\\"
> 
> Also, should we disable DELIMITER and NULL from sharing characters?

That's on about line 916, post-patch:

    /* Don't allow the delimiter to appear in the null string. */
    if (strchr(cstate->null_print, cstate->delim[0]) != NULL)
        ereport(ERROR,
                (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
                errmsg("COPY delimiter must not appear in the NULL specification")));

I suppose that a different error code might be The Right Thing™ here.

Cheers,
D
-- 
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 415 235 3778

Remember to vote!

In response to

Responses

pgsql-bugs by date

Next:From: David FetterDate: 2006-02-01 03:44:47
Subject: Re: [PATCHES] BUG #2221: Bad delimiters allowed in COPY ...
Previous:From: Kris JurkaDate: 2006-02-01 01:49:18
Subject: database level client_encoding setting check

pgsql-patches by date

Next:From: David FetterDate: 2006-02-01 03:44:47
Subject: Re: [PATCHES] BUG #2221: Bad delimiters allowed in COPY ...
Previous:From: Bruce MomjianDate: 2006-02-01 01:03:41
Subject: Re: [PATCHES] BUG #2221: Bad delimiters allowed in COPY ...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group