Re: [HACKERS] [PATCHES] WITH DELIMITERS in COPY

2002-04-16 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Gavin Sherry wrote: CREATE DATABASE also fills out a list in the same fashion =). I will however have a look at revising this patch to use DefElem later today. Oh, I see that now. Which method do people prefer. We should

Re: [HACKERS] [PATCHES] WITH DELIMITERS in COPY

2002-04-16 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] 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:

Re: [HACKERS] [PATCHES] WITH DELIMITERS in COPY

2002-04-16 Thread Bruce Momjian
Tom Lane wrote: 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,

Re: [HACKERS] [PATCHES] WITH DELIMITERS in COPY

2002-04-16 Thread Gavin Sherry
On Tue, 16 Apr 2002, Bruce Momjian wrote: 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:

Re: [HACKERS] [PATCHES] WITH DELIMITERS in COPY

2002-04-16 Thread Bruce Momjian
Gavin Sherry wrote: 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. Wouldn't a few macros clean this up better (ie, make it clearer)? #define CDBOPTDBPATH

Re: [HACKERS] [PATCHES] WITH DELIMITERS in COPY

2002-04-14 Thread Gavin Sherry
On Sun, 14 Apr 2002, Bruce Momjian wrote: Gavin, I will do the legwork on this if you wish. I think we need to No matter. I intended to submit a patch to fix this. use DefElem to store the COPY params, rather than using specific fields in CopyStmt. DefElem would have required

Re: [HACKERS] [PATCHES] WITH DELIMITERS in COPY

2002-04-14 Thread Peter Eisentraut
Gavin Sherry writes: The patch attached maintains backward compatibility. The syntax is as follows: COPY [BINARY] relname [WITH OIDS] FROM/TO [USING DELIMITERS delimiter] [WITH [ DELIMITER delimiter | NULL AS char | OIDS ]] I think we should lose the WITH

Re: [HACKERS] [PATCHES] WITH DELIMITERS in COPY

2002-04-14 Thread Bruce Momjian
Gavin, I see where you are going with the patch; creating a list in gram.y and stuffing CopyStmt directly there. However, I can't find any other instance of our stuffing things like that in gram.y. We do have cases using options like COPY in CREATE USER, and we do use DefElem. I realize it

Re: [HACKERS] [PATCHES] WITH DELIMITERS in COPY

2002-04-14 Thread Gavin Sherry
On Sun, 14 Apr 2002, Bruce Momjian wrote: Gavin, I see where you are going with the patch; creating a list in gram.y and stuffing CopyStmt directly there. However, I can't find any other instance of our stuffing things like that in gram.y. We do have cases using options like COPY in

Re: [HACKERS] [PATCHES] WITH DELIMITERS in COPY

2002-04-14 Thread Bruce Momjian
Gavin Sherry wrote: On Sun, 14 Apr 2002, Bruce Momjian wrote: Gavin, I see where you are going with the patch; creating a list in gram.y and stuffing CopyStmt directly there. However, I can't find any other instance of our stuffing things like that in gram.y. We do have cases

Re: [HACKERS] [PATCHES] WITH DELIMITERS in COPY

2002-04-13 Thread Bruce Momjian
Gavin, I will do the legwork on this if you wish. I think we need to use DefElem to store the COPY params, rather than using specific fields in CopyStmt. Would you send me your original patch so I am make sure I hit everything. I can't seem to find a copy. If you would like to work on it, I