Re: [GENERAL] Quoted NULLs with COPY FROM (and pgAdmin export data

2006-01-25 Thread Richard Huxton
George Pavlov wrote: This is actually turning into a bit of a pgAdmin issue: pgAdmin lets you export data in a format that seems to be unimportable back into the same table. If in the "Export data to file" form you check "all columns" under "Quoting" you will get quotes around your numeric NULLs

Re: [GENERAL] Quoted NULLs with COPY FROM (and pgAdmin export data options)

2006-01-24 Thread George Pavlov
> Quotes tend to imply a text field. I think you meant to say "quotes imply a non-null text field". And, yes, I am quite aware of that. The point of the thread was to see if there is any way of avoiding/overriding that assumption. > Assuming > you don't want to write a short Perl script to pre-

Re: [GENERAL] Quoted NULLs with COPY FROM

2006-01-24 Thread Richard Huxton
George Pavlov wrote: Did you try NULL AS ''? yes i did. that is the default and does not change the outcome (same errors about trying to insert an empty string into a numeric field. Well there's your problem. Quotes tend to imply a text field. Assuming you don't want to write a short Perl sc

Re: [GENERAL] Quoted NULLs with COPY FROM

2006-01-23 Thread George Pavlov
> > I need to load CSV files that have quotes in data fields > > that I want to > > map to NULLs in the destination table. So if I see > > ...,"",... that needs > > to be mapped to a NULL (in an INTEGER field in this > > particular case). > > Are there any COPY command options that can do that?

Re: [GENERAL] Quoted NULLs with COPY FROM

2006-01-23 Thread Bruce Momjian
George Pavlov wrote: > I need to load CSV files that have quotes in data fields that I want to > map to NULLs in the destination table. So if I see ...,"",... that needs > to be mapped to a NULL (in an INTEGER field in this particular case). > Are there any COPY command options that can do that? It

[GENERAL] Quoted NULLs with COPY FROM

2006-01-23 Thread George Pavlov
I need to load CSV files that have quotes in data fields that I want to map to NULLs in the destination table. So if I see ...,"",... that needs to be mapped to a NULL (in an INTEGER field in this particular case). Are there any COPY command options that can do that? It seems that PgSQL COPY expect