Re: COPY command with timestamp and NULLs - Mailing list pgsql-general

From Jeff Eckermann
Subject Re: COPY command with timestamp and NULLs
Date
Msg-id 043001c13a4a$20c99fc0$279c10ac@INTERNAL
Whole thread Raw
In response to COPY command with timestamp and NULLs  (Dwayne Miller <dmiller@espgroup.net>)
List pgsql-general
COPY expects NULL to be represented by "\N" by default.
Probably easiest to explicitly specify on the command line what you want
COPY to recognize as a NULL: "copy table from wherever with null as
'something';"

----- Original Message -----
From: "Dwayne Miller" <dmiller@espgroup.net>
To: <pgsql-general@postgresql.org>
Sent: Monday, September 10, 2001 2:51 PM
Subject: [GENERAL] COPY command with timestamp and NULLs


> I recently upgraded to 7.1.3.  I was experimenting with a script to
> export data from FoxPro into an SQL file and multiple data files.  The
> SQL file creates the tables, indexes, foreign keys, etc, and calls the
> COPY command to load the data from the appropriate data files.
>
> It appears, and I could easily be mistaken, that the COPY command does
> not allow NULLs into a timestamp field, even though the field is defined
> to accept nulls.  Actually, it appears that the behavior of the COPY
> command changed as I believe it would accept nulls in the prior release
> 7.1.2.
>
> In any case, I'm using the COPY command WITH NULL AS '^N'. And the
> datafile contains ^N in timestamp fields that could be NULL, but the
> command fails with an invalid timestamp error, referencing the first
> line that contains the '^N' null sequence.
>
> Any thoughts?
>
> Thanks,
> Dwayne
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
>


pgsql-general by date:

Previous
From: Shaun Thomas
Date:
Subject: Re: How to make a REALLY FAST db server?
Next
From: Philip Hallstrom
Date:
Subject: Questions about tuning on FreeBSD...