Re: Copying null values - Mailing list pgsql-sql

From Christof Glaser
Subject Re: Copying null values
Date
Msg-id 01041016210700.00767@pinguin
Whole thread Raw
In response to Copying null values  (Amanda Riera <amanda@labtie.mmt.upc.es>)
List 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


pgsql-sql by date:

Previous
From: Thomas Good
Date:
Subject: The Momjian Tome / DBA Certification
Next
From: Joel Burton
Date:
Subject: Re: problem with copy command