pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Luckys <plpgsql@gmail.com>
To: Achilleus Mantzios <achill@matrix.gatewaynet.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: COPY tablename FROM and null values
Date: Wed, 22 Mar 2006 16:27:25 +0400
Message-ID: <b80d582c0603220427t356241bmae03ee7a042418a6@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0603221528500.31329-100000@matrix.gatewaynet.com>
References: <1143026331.4730.23.camel@geologia5.agora.ing.unipg.it>
	<Pine.LNX.4.44.0603221528500.31329-100000@matrix.gatewaynet.com>

On 3/22/06, Achilleus Mantzios <achill@matrix.gatewaynet.com> wrote:
>
> 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.


or Replace the empty spaces in the file with some other value (0.0)

>
> > thank you very much
> >
> > Ivan
> >
> >
> >
> >
> >
>
> --
> -Achilleus
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>


view thread (5+ messages)  latest in thread

Message-ID: <b80d582c0603220427t356241bmae03ee7a042418a6@mail.gmail.com>
Permalink:  ../b80d582c0603220427t356241bmae03ee7a042418a6@mail.gmail.com/
Also on:    postgresql.org/message-id/b80d582c0603220427t356241bmae03ee7a042418a6@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: plpgsql@gmail.com, achill@matrix.gatewaynet.com
  Subject: Re: COPY tablename FROM and null values
  In-Reply-To: <b80d582c0603220427t356241bmae03ee7a042418a6@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox