Received: from gl.aser.de (gl.aser.de [213.252.128.30]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3AECr851993 for ; Tue, 10 Apr 2001 10:12:53 -0400 (EDT) (envelope-from gcg@gl.aser.de) Received: from pinguin (gcg@node111.dial.Uni-Magdeburg.DE [141.44.160.111]) by gl.aser.de (8.11.2/8.11.2/Debian 8.11.2-1) with SMTP id f3AEK0f10101; Tue, 10 Apr 2001 16:20:06 +0200 Content-Type: text/plain; charset="iso-8859-1" From: Christof Glaser Organization: gl.aser software engineering . internet service To: Amanda Riera , pgsql Subject: Re: Copying null values Date: Tue, 10 Apr 2001 16:21:07 +0200 X-Mailer: KMail [version 1.2] References: <3AD2F9DD.D1A91274@labtie.mmt.upc.es> In-Reply-To: <3AD2F9DD.D1A91274@labtie.mmt.upc.es> MIME-Version: 1.0 Message-Id: <01041016210700.00767@pinguin> Content-Transfer-Encoding: 8bit X-Archive-Number: 200104/135 X-Sequence-Number: 2482 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