Re: Undocumented feature costs a lot of performance in COPY

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Undocumented feature costs a lot of performance in COPY
Date: 2001-12-04 20:20:52
Message-ID: 200112042020.fB4KKqI28979@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Yes, please fix it. In fact, I think we should throw an error if more
> > than one character is specified as a delimiter. Saying we ignore
> > multiple characters in the documentation is not enough when we silently
> > ignore them in the code.
>
> Well, it'd be an easy enough addition:
>
> if (strlen(delim) != 1)
> elog(ERROR, "COPY delimiter must be a single character");
>
> This isn't multibyte-aware, but then neither is the implementation;
> delimiters that are multibyte characters won't work at the moment.

My point was that the documentation was saying it could only be one
character, and that we would ignore any characters after the first one,
but there was no enforcement in the code.

The right way to do it is to just say in the documentation it has to be
one character, and throw an error in the code if it isn't.

Limitations should be enforced in the code, if possible, not just
mentioned in the documenation, which may or may not get read.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-12-04 20:22:58 Re: Undocumented feature costs a lot of performance in COPY IN
Previous Message Doug McNaught 2001-12-04 20:19:27 Re: Undocumented feature costs a lot of performance in COPY IN

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-12-04 20:22:58 Re: Undocumented feature costs a lot of performance in COPY IN
Previous Message Doug McNaught 2001-12-04 20:19:27 Re: Undocumented feature costs a lot of performance in COPY IN