From: | Christof Glaser <gcg(at)gl(dot)aser(dot)de> |
---|---|
To: | Amanda Riera <amanda(at)labtie(dot)mmt(dot)upc(dot)es>, pgsql <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Copying null values |
Date: | 2001-04-10 14:21:07 |
Message-ID: | 01041016210700.00767@pinguin |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Tuesday, 10. April 2001 14:17, Amanda Riera wrote:
> I would like empty fields from a file being recognised as NULL
> values. It doesn't seem to work when a COPY is done, but when I make
> an INSERT without
> specifying the value, this is recognised as a NULL
>
> The file I want to copy is:
>
> ,0,Unknown,01/01/3000,01/01/3000,01/01/3000,0,
> 1,3,,01/01/3000,01/01/3000,01/01/3000,0,
> 2,,Unknown,01/01/3000,01/01/3000,01/01/3000,0,
>
> What I am doing is:
>
> COPY bill FROM '/home/amanda/informatica/provas/bills-copy.dat' USING
> DELIMITERS ',' WITH NULL AS '\,';
Just try
COPY ... WITH NULL AS '';
HTH,
Christof
--
gl.aser . software engineering . internet service
http://gl.aser.de/ . Planckstraße 7 . D-39104 Magdeburg
Tel. +49.391.7 44 77 10 . Fax +49.391.7 44 77 13 . Mobil 0177.77 92 84 3
From | Date | Subject | |
---|---|---|---|
Next Message | Joel Burton | 2001-04-10 15:36:43 | Re: problem with copy command |
Previous Message | Thomas Good | 2001-04-10 12:26:35 | The Momjian Tome / DBA Certification |