Re: valid NULL DATE value - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: valid NULL DATE value
Date
Msg-id Pine.LNX.4.30.0108241528250.677-100000@peter.localdomain
Whole thread Raw
In response to Re: valid NULL DATE value  ("Oliver Elphick" <olly@lfix.co.uk>)
Responses Re: valid NULL DATE value
List pgsql-general
Oliver Elphick writes:

> Tony Grant wrote:
>   >Hello,
>   >
>   >I am importing via pgaccess a text file from another non-postgres
>   >database and the NULL DATE values are written like 00/00/00.
>   >
>   >What I have tried is replacing 00/00/00 by 9/9/1999 and setting the
>   >style to european and I am getting 'can't parse /9/1999' errors.
>   >
>   >How do I go about importing DATE?
>
> With INSERT, leave the field out of the list or insert NULL.
>
> With COPY, specify NULL as \N.  (You can redefine that - see COPY syntax.)

Hmm, you could use COPY ... WITH NULL AS '00/00/00', though that may spell
trouble if any non-date fields usefully contain that value.  (Probably
unlikely.)

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: number of parameters to a stored procedure
Next
From: Tom Lane
Date:
Subject: Re: store in bytea