Re: [PATCHES] 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: 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 01:03:41
Message-ID: 200602010103.k1113fb19320@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches


Uh, couldn't the delimiter be a backslash in CVS mode?

+ #define BADCHARS "\r\n\\"

Also, should we disable DELIMITER and NULL from sharing characters?

---------------------------------------------------------------------------

David Fetter wrote:
> On Sun, Jan 29, 2006 at 10:20:47PM -0500, Neil Conway wrote:
> > On Sun, 2006-01-29 at 17:03 -0800, David Fetter wrote:
> > > Another followup, this time with the comment done right.
> >
> > + /* Disallow the forbidden_delimiter strings */
> > + if (strcspn(cstate->delim, BADCHARS) != 1)
> > + elog(ERROR, "COPY delimiter cannot be %#02x",
> > + *cstate->delim);
> > +
> >
> > The comment is still wrong: referencing "forbidden_delimiter" makes
> > it sound like there is something named forbidden_delimiter, but
> > there is not (at least in the patch as submitted).
> >
> > The patch should also use ereport rather than elog, because this
> > error message might reasonably be encountered by the user.
>
> Patch with BADCHARS attached :)
>
> Cheers,
> D
> --
> David Fetter david(at)fetter(dot)org http://fetter.org/
> phone: +1 415 235 3778
>
> Remember to vote!

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kris Jurka 2006-02-01 01:49:18 database level client_encoding setting check
Previous Message Bruce Momjian 2006-02-01 00:50:17 Re: [BUGS] BUG #2195: log_min_messages crash server when in

Browse pgsql-patches by date

  From Date Subject
Next Message David Fetter 2006-02-01 02:48:10 Re: [PATCHES] BUG #2221: Bad delimiters allowed in COPY ...
Previous Message Bruce Momjian 2006-02-01 00:50:17 Re: [BUGS] BUG #2195: log_min_messages crash server when in