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 B57DF9DC9F7 for ; Wed, 22 Mar 2006 10:52:11 -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 69150-01 for ; Wed, 22 Mar 2006 10:52:15 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 2B6A09DC9E0 for ; Wed, 22 Mar 2006 10:52:08 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k2MEqDop016350; Wed, 22 Mar 2006 09:52:13 -0500 (EST) To: marchesini@unipg.it cc: pgsql-sql@postgresql.org Subject: Re: COPY tablename FROM and null values In-reply-to: <1143026331.4730.23.camel@geologia5.agora.ing.unipg.it> References: <1143026331.4730.23.camel@geologia5.agora.ing.unipg.it> Comments: In-reply-to ivan marchesini message dated "Wed, 22 Mar 2006 12:18:51 +0100" Date: Wed, 22 Mar 2006 09:52:13 -0500 Message-ID: <16349.1143039133@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.113 required=5 tests=[AWL=0.113] X-Spam-Score: 0.113 X-Spam-Level: X-Archive-Number: 200603/352 X-Sequence-Number: 24698 ivan marchesini writes: > 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) This should work, unless the file is set up so that the second TAB is missing when column3 is "empty". If so, you'll need to fix that. COPY is going to complain if there aren't exactly two TABs on every line. regards, tom lane