Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ... - Mailing list pgsql-patches

From David Fetter
Subject Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ...
Date
Msg-id 20060201065605.GC9577@fetter.org
Whole thread Raw
In response to Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ...  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ...  (Andrew Dunstan <andrew@dunslane.net>)
Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ...  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
On Wed, Feb 01, 2006 at 01:16:08AM -0500, Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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.

Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 415 235 3778

Remember to vote!

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ...
Next
From: Simon Riggs
Date:
Subject: Re: BTree vacuum before page splitting