Re: COPY tablename FROM and null values

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: marchesini(at)unipg(dot)it
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: COPY tablename FROM and null values
Date: 2006-03-22 14:52:13
Message-ID: 16349.1143039133@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

ivan marchesini <marchesini(at)unipg(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Maciej Piekielniak 2006-03-22 17:17:15 How to optimize this query?
Previous Message Davidson, Robert 2006-03-22 14:49:20 Re: Using a parameter in Interval