Skip site navigation (1) Skip section navigation (2)

Re: COPY tablename FROM and null values

From: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: ivan marchesini <marchesini(at)unipg(dot)it>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: COPY tablename FROM and null values
Date: 2006-03-22 13:29:56
Message-ID: Pine.LNX.4.44.0603221528500.31329-100000@matrix.gatewaynet.com (view raw or flat)
Thread:
Lists: pgsql-sql
O ivan marchesini έγραψε στις Mar 22, 2006 :

> 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???

batch edit your file (with sed,awk,perl,C,java,...) and build your 
explicit INSERT statements in some version of your file.

> 
> thank you very much
> 
> Ivan
>  
> 
> 
> 
> 

-- 
-Achilleus


In response to

Responses

pgsql-sql by date

Next:From: Davidson, RobertDate: 2006-03-22 14:49:20
Subject: Re: Using a parameter in Interval
Previous:From: JSPDate: 2006-03-22 12:33:11
Subject: Re: COPY tablename FROM and null values

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group