Re: [PATCHES] WITH DELIMITERS in COPY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] WITH DELIMITERS in COPY
Date: 2002-04-16 23:34:17
Message-ID: 1894.1019000057@sss.pgh.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:
> The code that bothered me about the CREATE DATABASE param processing
> was:

> /* process additional options */
> foreach(l, $5)
> {
> List *optitem = (List *) lfirst(l);

> switch (lfirsti(optitem))
> {
> case 1:
> n->dbpath = (char *) lsecond(optitem);
> break;
> case 2:
> n->dbtemplate = (char *) lsecond(optitem);
> break;
> case 3:
> n->encoding = lfirsti(lnext(optitem));
> break;
> case 4:
> n->dbowner = (char *) lsecond(optitem);
> break;
> }
> }

> I see what it is doing, but it seems quite unclear. Seeing that people
> are using this as a pattern for other param processing, I will work on a
> patch to convert this to DefElem.

Oh, I think we were talking at cross-purposes then. What you're really
unhappy about is that this uses a list of two-element sublists? Yeah,
I agree, that's a messy data structure; a list of DefElem would be
perhaps cleaner. Not sure if it matters all that much though, since the
list only exists in the context of a few productions in gram.y. Perhaps
adding a couple of lines of documentation would be better than changing
the code.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-04-16 23:49:45 Re: [PATCHES] WITH DELIMITERS in COPY
Previous Message Bruce Momjian 2002-04-16 23:21:50 Re: regexp character class locale awareness patch

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-04-16 23:49:45 Re: [PATCHES] WITH DELIMITERS in COPY
Previous Message Bruce Momjian 2002-04-16 21:27:21 Re: [PATCHES] WITH DELIMITERS in COPY