Re: NULL TIMESTAM problem - Mailing list pgsql-general

From Michael Fuhr
Subject Re: NULL TIMESTAM problem
Date
Msg-id 20060309192610.GA91550@winnie.fuhr.org
Whole thread Raw
In response to NULL TIMESTAM problem  ("Enrique Sánchez" <sancheztru@hotmail.com>)
Responses Re: NULL TIMESTAM problem  ("Enrique Sánchez" <sancheztru@hotmail.com>)
List 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

pgsql-general by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: multi-column aggregates
Next
From: Michael Fuhr
Date:
Subject: Re: Data corruption zero a file - help!!