Re: COPY tablename FROM and null values - Mailing list pgsql-sql

From Tom Lane
Subject Re: COPY tablename FROM and null values
Date
Msg-id 16349.1143039133@sss.pgh.pa.us
Whole thread Raw
In response to COPY tablename FROM and null values  (ivan marchesini <marchesini@unipg.it>)
List pgsql-sql
ivan marchesini <marchesini@unipg.it> 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


pgsql-sql by date:

Previous
From: "Davidson, Robert"
Date:
Subject: Re: Using a parameter in Interval
Next
From: Maciej Piekielniak
Date:
Subject: How to optimize this query?