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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, neilc(at)samurai(dot)com, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ...
Date: 2006-02-01 14:10:51
Message-ID: 200602011410.k11EApH14839@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches

David Fetter wrote:
> On Wed, Feb 01, 2006 at 01:16:08AM -0500, Tom Lane wrote:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > Attached is a patch that errors for \r and \n in delimiter and
> > > null. I kept the ERRCODE_FEATURE_NOT_SUPPORTED error code because
> > > that is what all the other error tests use in the copy code in
> > > that area.
> >
> > I'd go with INVALID_PARAMETER_VALUE, I think. ISTM that
> > FEATURE_NOT_SUPPORTED is appropriate for places where we might
> > someday support the case the error is rejecting. For instance the
> > error just above your patch is for a multi-character delimiter
> > string. That isn't completely senseless, it's just not implemented.
> > But we're not ever going to allow a delimiter setting that conflicts
> > with end-of-line, and I don't foresee allowing some other value for
> > end-of-line ;-) ... so this check isn't going to be removed someday.
>
> I don't know why you're saying that the EOL character will never be
> changeable. Other DBs (yes, I know that's not an argument for doing
> this, but please bear with me) let you set the "field separator" aka
> our DELIMITER and "record separator" aka our newline (or CRLF, in some
> cases. Oy!).
>
> Anyhow, Bruce's patch still allows backslash as a delimiter, which can
> cause *all* kinds of fun if not disallowed.

OK, updated patch, which disallows backslash as a delimiter, and updated
error return code.

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

Attachment Content-Type Size
unknown_filename text/plain 1.3 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2006-02-01 15:21:59 Re: BUG #2230: cannot return a setof column referenced types
Previous Message Andrew Dunstan 2006-02-01 12:55:39 Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ...

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2006-02-01 15:24:11 test, please ignore
Previous Message Dave Page 2006-02-01 14:05:09 Re: [HACKERS] FW: PGBuildfarm member snake Branch REL8_0_STABLE Status changed from OK to Make failure