pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christof Glaser <gcg@gl.aser.de>
To: Amanda Riera <amanda@labtie.mmt.upc.es>
To: pgsql <pgsql-sql@postgresql.org>
Subject: Re: Copying null values
Date: Tue, 10 Apr 2001 16:21:07 +0200
Message-ID: <01041016210700.00767@pinguin> (raw)
In-Reply-To: <3AD2F9DD.D1A91274@labtie.mmt.upc.es>
References: <3AD2F9DD.D1A91274@labtie.mmt.upc.es>

On Tuesday, 10. April 2001 14:17, Amanda Riera wrote:
> I would like empty fields from a file being recognised as NULL
> values. It doesn't seem to work when a COPY is done, but when I make
> an INSERT without
> specifying the value, this is recognised as a NULL
>
> The file I want to copy is:
>
> ,0,Unknown,01/01/3000,01/01/3000,01/01/3000,0,
> 1,3,,01/01/3000,01/01/3000,01/01/3000,0,
> 2,,Unknown,01/01/3000,01/01/3000,01/01/3000,0,
>
> What I am doing is:
>
> COPY bill FROM '/home/amanda/informatica/provas/bills-copy.dat' USING
> DELIMITERS ',' WITH NULL AS '\,';

Just try 
  COPY ... WITH NULL AS ''; 

HTH,

Christof
-- 
          gl.aser . software engineering . internet service
       http://gl.aser.de/  . Planckstraße 7 . D-39104 Magdeburg
Tel. +49.391.7 44 77 10 . Fax +49.391.7 44 77 13 . Mobil 0177.77 92 84 3



view thread (2+ messages)

Message-ID: <01041016210700.00767@pinguin>
Permalink:  ../01041016210700.00767@pinguin/
Also on:    postgresql.org/message-id/01041016210700.00767@pinguin

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: gcg@gl.aser.de, amanda@labtie.mmt.upc.es
  Subject: Re: Copying null values
  In-Reply-To: <01041016210700.00767@pinguin>
  References: <3AD2F9DD.D1A91274@labtie.mmt.upc.es> <01041016210700.00767@pinguin>

* 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