Re: NULL TIMESTAM problem

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Enrique Sánchez <sancheztru(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: NULL TIMESTAM problem
Date: 2006-03-09 19:26:10
Message-ID: 20060309192610.GA91550@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 09, 2006 at 12:49:14PM -0600, Enrique Sánchez wrote:
> I nedd to fill a database table x from a file With the COPY command an the
> delimiter '*'.
> This table has a timestamp null column (I declared like: ' birthday
> timestamp NULL' ).
>
> But when I try to insert NULL values(specified in the file), postgres throw
> an error.

What's the error? How are the NULL values specified in the file?

> I don't know how can I specify this NULL value wkthout an '\N' character.

See the COPY documentation -- COPY has a NULL option that allows
you to specify what string should be interpreted as NULL. Recent
versions also have a CSV option that interprets empty strings as
NULL.

http://www.postgresql.org/docs/8.1/interactive/sql-copy.html

(Use the documentation for whatever version you're running.)

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2006-03-09 19:43:36 Re: Data corruption zero a file - help!!
Previous Message Merlin Moncure 2006-03-09 19:18:28 Re: multi-column aggregates