X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 90BE89DCD58 for ; Wed, 22 Mar 2006 08:16:53 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 29909-01 for ; Wed, 22 Mar 2006 08:16:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from trabant.cianoz.org (host31-194-149-62.serverdedicati.aruba.it [62.149.194.31]) by postgresql.org (Postfix) with ESMTP id 38C829DCD4C for ; Wed, 22 Mar 2006 08:16:50 -0400 (AST) Received: by trabant.cianoz.org (Postfix, from userid 1031) id E39FD3840F0; Wed, 22 Mar 2006 13:16:52 +0100 (CET) Received: from geologia5.agora.ing.unipg.it (geologia5.agora.ing.unipg.it [141.250.41.212]) by trabant.cianoz.org (Postfix) with ESMTP id B546B384077 for ; Wed, 22 Mar 2006 13:16:50 +0100 (CET) Subject: COPY tablename FROM and null values From: ivan marchesini Reply-To: marchesini@unipg.it To: pgsql-sql@postgresql.org Content-Type: text/plain Organization: University of Perugia Date: Wed, 22 Mar 2006 12:18:51 +0100 Message-Id: <1143026331.4730.23.camel@geologia5.agora.ing.unipg.it> Mime-Version: 1.0 X-Mailer: Evolution 2.4.2.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80 (http://www.clamav.net) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.305 required=5 tests=[AWL=0.029, MAILTO_TO_SPAM_ADDR=0.276] X-Spam-Score: 0.305 X-Spam-Level: X-Archive-Number: 200603/347 X-Sequence-Number: 24693 Dear users, I'm working on a Postgres 7.4 server I have a .txt file, containing some tabular data, where data are delimited by TABs. there are 3 columns: column1 int4, column2 float8, column3 float8 the problem is that column3 contains also null values (i.e. sometimes is empty) so when I try to use COPY tablename FROM 'filename.txt' I obtain an error I have tried also using " WITH NULL AS ' ' " but without good results... can someone explain me how to solve this problem??? thank you very much Ivan -- Ivan Marchesini Department of Civil and Environmental Engineering University of Perugia Via G. Duranti 93/a 06125 Perugia (Italy) e-mail: marchesini@unipg.it ivan.marchesini@gmail.com tel: +39(0)755853760 fax: +39(0)755853756 jabber: geoivan73@jabber.org