Re: Undocumented feature costs a lot of performance in COPY

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: Undocumented feature costs a lot of performance in COPY
Date: 2002-01-05 01:32:29
Message-ID: Pine.LNX.4.21.0201051223290.19760-101000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Fri, 28 Dec 2001, Bruce Momjian wrote:

> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > We could support keywords DELIMITER and DELIMITERS and only document
> > > the first one.
> >
> > One could also argue that it should be WITH DELIMITER for more
> > consistency with the other optional clauses.
> >
> > But let's put that in the TODO list, not try to get it done now...
>
> Updated TODO:
>
> COPY
> ...
> o Change syntax to WITH DELIMITER, (keep old syntax around?)
>

An attached patch implements this. The problem with implementing this is
that the new syntax is:

.... WITH DELIMITERS '<delim>' WITH NULL AS '<char>'

Naturally, this leads to a shift/reduce conflict. Solution is more or less
that used with CREATE DATABASE WITH ... WITH ... etc. The only ugly bit
was mixing this with the old USING DELIMITERS ... syntax. I don't like the
solution -- I get the feeling there's a better way to do it.

The other option of course is to update yylex() to create a new token
in the same way that the UNIONJOIN terminal is created. But I think this
is a bit messy.

Ideas or is this okay?

Gavin

Attachment Content-Type Size
copy.patch.gz application/x-gzip 1.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-01-05 01:44:17 Re: LWLock contention: I think I understand the problem
Previous Message Tatsuo Ishii 2002-01-05 01:25:32 Re: LWLock contention: I think I understand the problem

Browse pgsql-patches by date

  From Date Subject
Next Message Gavin Sherry 2002-01-05 01:59:32 Re: [HACKERS] Updated TODO item
Previous Message Jon Marks 2002-01-04 21:59:57 OOPS! Bad libpq patch last time..