Re: Undocumented feature costs a lot of performance in COPY - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Undocumented feature costs a lot of performance in COPY
Date
Msg-id 200112042020.fB4KKqI28979@candle.pha.pa.us
Whole thread Raw
In response to Re: Undocumented feature costs a lot of performance in COPY IN  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Bruce Momjian <pgman@candle.pha.pa.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@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bill Studenmund
Date:
Subject: Re: Undocumented feature costs a lot of performance in
Next
From: Tom Lane
Date:
Subject: Re: FW: [CYGWIN] 7.2b3 postmaster doesn't start on Win98