Re: [HACKERS] COPY WITH CSV FORCE QUOTE * -- REVIEW

2009-07-24 Thread Andrew Dunstan
Josh Berkus wrote: Stuff someone else should do: a. review code b. review code format I am done with this review. I have reviewed this and made a small tweak in the docco. I'm just about ready to commit this, but I'm still slightly worried that passing NULL to denote all columns in this

Re: [HACKERS] COPY WITH CSV FORCE QUOTE * -- REVIEW

2009-07-24 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: I have reviewed this and made a small tweak in the docco. I'm just about ready to commit this, but I'm still slightly worried that passing NULL to denote all columns in this piece of grammar: | FORCE QUOTE '*' {

Re: [HACKERS] COPY WITH CSV FORCE QUOTE * -- REVIEW

2009-07-24 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: I have reviewed this and made a small tweak in the docco. I'm just about ready to commit this, but I'm still slightly worried that passing NULL to denote all columns in this piece of grammar: | FORCE QUOTE

Re: [HACKERS] COPY WITH CSV FORCE QUOTE * -- REVIEW

2009-07-20 Thread Josh Berkus
Itagaki-san, On Apple OS 10.5: 1. new patch applied cleanly 2. new patch built cleanly 3. regression tests pass 4. Tested following operations: postgres=# COPY marchlog TO '/tmp/marchlog1.csv' with csv header; COPY 81097 postgres=# COPY marchlog TO '/tmp/marchlog2.csv' with csv header force

Re: [HACKERS] COPY WITH CSV FORCE QUOTE *

2009-07-20 Thread Josh Berkus
On 7/16/09 1:55 PM, Andrew Dunstan wrote: Well, somebody had better suggest a syntax for it, preferably without adding yet another keyword. Actually, all that needs to happen is for NULL AS to accept '' as a string. Right now that produces: ERROR: CSV quote character must not appear in

Re: [HACKERS] COPY WITH CSV FORCE QUOTE *

2009-07-20 Thread Andrew Dunstan
Josh Berkus wrote: On 7/16/09 1:55 PM, Andrew Dunstan wrote: Well, somebody had better suggest a syntax for it, preferably without adding yet another keyword. Actually, all that needs to happen is for NULL AS to accept '' as a string. Right now that produces: ERROR: CSV quote character

Re: [HACKERS] COPY WITH CSV FORCE QUOTE * -- REVIEW

2009-07-16 Thread Josh Berkus
All, 1) Patch applies cleanly against CVS head. 2) Patch compiles and builds cleanly. 3) Unable to check docs because of general doc build problems. 4) Tested the following commands, using a 10MB table of PostgreSQL log data: postgres=# COPY marchlog TO '/tmp/marchlog1.csv' with csv header;

Re: [HACKERS] COPY WITH CSV FORCE QUOTE *

2009-07-16 Thread Josh Berkus
Andrew, FORCE NOT NULL is in any case a fairly blunt instrument - it doesn't work for a column of any type that doesn't accept an empty string as valid input, such as numeric types. Con: this allows COPY to produce output which cannot be reloaded into PostgreSQL. Pro: there is a lot of

Re: [HACKERS] COPY WITH CSV FORCE QUOTE *

2009-07-16 Thread Andrew Dunstan
Josh Berkus wrote: Andrew, FORCE NOT NULL is in any case a fairly blunt instrument - it doesn't work for a column of any type that doesn't accept an empty string as valid input, such as numeric types. Con: this allows COPY to produce output which cannot be reloaded into PostgreSQL. Pro:

Re: [HACKERS] COPY WITH CSV FORCE QUOTE * -- REVIEW

2009-07-16 Thread Robert Haas
On Thu, Jul 16, 2009 at 2:47 PM, Josh Berkusj...@agliodbs.com wrote: Unless there are other things we want to test (CLOBs?) I think the patch is probably ready for code review of the FORCE QUOTE * portion. I think perhaps we should ask the patch author to remove the NOT NULL stuff first?

Re: [HACKERS] COPY WITH CSV FORCE QUOTE * -- REVIEW

2009-07-16 Thread Josh Berkus
On 7/16/09 12:53 PM, Robert Haas wrote: On Thu, Jul 16, 2009 at 2:47 PM, Josh Berkusj...@agliodbs.com wrote: Unless there are other things we want to test (CLOBs?) I think the patch is probably ready for code review of the FORCE QUOTE * portion. I think perhaps we should ask the patch author

Re: [HACKERS] COPY WITH CSV FORCE QUOTE *

2009-07-16 Thread Josh Berkus
Andrew, AFAICT on a brief look at the patch, it doesn't affect the quoting of nulls on export, it just allows * as an alias for all columns for FORCE QUOTE (as well as FORCE NOT NULL). But FORCE QUOTE has never forced quoting of null values, only non-null values. We have never quoted null

Re: [HACKERS] COPY WITH CSV FORCE QUOTE *

2009-07-16 Thread Chris Spotts
Josh Berkus wrote: Andrew, AFAICT on a brief look at the patch, it doesn't affect the quoting of nulls on export, it just allows * as an alias for all columns for FORCE QUOTE (as well as FORCE NOT NULL). But FORCE QUOTE has never forced quoting of null values, only non-null values. We have

Re: [HACKERS] COPY WITH CSV FORCE QUOTE *

2009-07-16 Thread Andrew Dunstan
Chris Spotts wrote: As for importing data from programs that produce all values in quotes including null/missing values (your pro case above), arguably what we need is another flag that would turn an empty string into a null. h, TODO, please? There's a lot of this out there, and I've

Re: [HACKERS] COPY WITH CSV FORCE QUOTE * -- REVIEW

2009-07-16 Thread Itagaki Takahiro
Josh Berkus j...@agliodbs.com wrote: On 7/16/09 12:53 PM, Robert Haas wrote: I think perhaps we should ask the patch author to remove the NOT NULL stuff first? Yes, current status is Waiting on Author. OK, I removed FORCE NOT NULL stuff from the patch. The attached patch only adds FORCE

Re: [HACKERS] COPY WITH CSV FORCE QUOTE *

2009-07-14 Thread Itagaki Takahiro
Jaime Casanova jcasa...@systemguards.com.ec wrote: i can find value for FORCE QUOTE * but what's the use case for FORCE NOT NULL? NULLs are not quoted (to be ,, ) because empty strings are written as . It comes from original implementation and not from my patch. I think we don't need to

Re: [HACKERS] COPY WITH CSV FORCE QUOTE *

2009-07-14 Thread Itagaki Takahiro
Jaime Casanova jcasa...@systemguards.com.ec wrote: i can find value for FORCE QUOTE * but what's the use case for FORCE NOT NULL? Oh, sorry. I misread your mail. The patch adds * options FORCE QUOTE and FORCE NOT NULL, too. Both of * mean all-columns for each options. The attached is an

Re: [HACKERS] COPY WITH CSV FORCE QUOTE *

2009-07-14 Thread Jaime Casanova
On Tue, Jul 14, 2009 at 2:26 AM, Itagaki Takahiroitagaki.takah...@oss.ntt.co.jp wrote: Jaime Casanova jcasa...@systemguards.com.ec wrote: i can find value for FORCE QUOTE * but what's the use case for FORCE NOT NULL? Oh, sorry. I misread your mail. The patch adds * options FORCE QUOTE

Re: [HACKERS] COPY WITH CSV FORCE QUOTE *

2009-07-14 Thread Andrew Dunstan
Itagaki Takahiro wrote: Jaime Casanova jcasa...@systemguards.com.ec wrote: i can find value for FORCE QUOTE * but what's the use case for FORCE NOT NULL? Oh, sorry. I misread your mail. The patch adds * options FORCE QUOTE and FORCE NOT NULL, too. Both of * mean all-columns for

Re: [HACKERS] COPY WITH CSV FORCE QUOTE *

2009-07-13 Thread Jaime Casanova
On Mon, May 11, 2009 at 11:49 PM, Itagaki Takahiroitagaki.takah...@oss.ntt.co.jp wrote: Hi, The attached is a WIP patch add a support of '*' for FORCE QUOTE and FORCE NOT NULL options. I'd like to submit it for the next commit fest (8.5). Comments welcome. this patch applies almost cleanly

[HACKERS] COPY WITH CSV FORCE QUOTE *

2009-05-11 Thread Itagaki Takahiro
Hi, FORCE QUOTE option of COPY WITH CSV requires an explicit column list, but '*' (all columns) would be also useful for typical usages. I searched the ML archive and found one request before: | COPY TO with FORCE QUOTE * | http://archives.postgresql.org/pgsql-sql/2008-08/msg00084.php The