Re: [INTERFACES] copy command & null datetime

From: "Brett W(dot) McCoy" <bmccoy(at)lan2wan(dot)com>
To: "Ken J(dot) Wright" <ken(at)ori-ind(dot)com>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] copy command & null datetime
Date: 1999-03-08 05:49:58
Message-ID: Pine.LNX.4.04.9903080043450.10058-100000@dragosani.lan2wan.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Sun, 7 Mar 1999, Ken J. Wright wrote:

> The following example will cause COPY to fail on input:
>
> xxx|yyy|zzz||aaa|bbb|
>
> where the empty field in between zzz & aaa is of type datetime (don't know
> about other types). I know a \N will fix this, but interpreting an empty
> import field as NULL would certainly beef up COPY as other database systems
> don't output the \N which is unique to PostgreSQL. Wish list item?

Yes, I discovered this little issue the other day. What is this \N
option, though? I have some 900000+ records out of a 2.1 million row
table that have NULL date fields. I ended up sticking in a dummy date (of
like 1901) for those, because I knew that valid dates stopped at a
particular lower cutoff date of around 1968, then ignore the earlier date
altogether.

Brett W. McCoy
http://www.lan2wan.com/~bmccoy/
-----------------------------------------------------------------------
A baby is God's opinion that the world should go on.
-- Carl Sandburg

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GAT dpu s:-- a C++++ UL++++$ P+ L+++ E W++ N+ o K- w--- O@ M@ !V PS+++
PE Y+ PGP- t++ 5- X+ R+@ tv b+++ DI+++ D+ G++ e>++ h+(---) r++ y++++
------END GEEK CODE BLOCK------

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Ken J. Wright 1999-03-08 06:26:23 Re: [INTERFACES] copy command & null datetime
Previous Message Ken J. Wright 1999-03-08 03:07:53 copy command & null datetime