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

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ...
Дата
Msg-id 20060201034446.GD7231@fetter.org
обсуждение исходный текст
Ответ на 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>)
Список pgsql-patches
On Tue, Jan 31, 2006 at 09:50:26PM -0600, Andrew Dunstan wrote:
> David Fetter said:
> > 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?
>
> Using backslash as a delimiter in CSV would be odd, to say the least. As an
> escape char it is occasionally used, but not as a delimiter in my
> experience. Maybe we should apply the "be liberal in what you accept" rule,
> but I think this would be stretching it.

<aol>So do I.</aol>

> >> 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.
>
> ERRCODE_WHAT WERE_YOU_THINKING ?

That's an excellent candidate, or maybe ERRCODE_INVALID_PARAMETER_VALUE.
My vote is for ERRCODE_D00D_WTF ;)

Maybe we need an error code for mutually incompatible param values.

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

Remember to vote!

В списке pgsql-patches по дате отправления:

Предыдущее
От: "Andrew Dunstan"
Дата:
Сообщение: Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ...
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [BUGS] BUG #2221: Bad delimiters allowed in COPY ...