Thread: How to load nulls into timestamp field

How to load nulls into timestamp field

From
Pam Wampler
Date:
If I am trying to load data into tables:
using psql  -c "\copy $file from $file using delimiters | "

and the table has a column of datatype timestamp that allows nulls,
the input record has the delimiter | in its place --
I get the ERROR:  copy: line 1, Bad timestamp external representation ''

why?  please help

Pam Wampler

Re: How to load nulls into timestamp field

From
"Joshua b. Jore"
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I seem to remember having similar problems. Use the additional syntax
"WITH NULL AS ''". That redefined NULL (during the copy) from \N to the
empty string.

Joshua b. Jore
http://www.greentechnologist.org

On Tue, 19 Feb 2002, Pam Wampler wrote:

> If I am trying to load data into tables:
> using psql  -c "\copy $file from $file using delimiters | "
>
> and the table has a column of datatype timestamp that allows nulls,
> the input record has the delimiter | in its place --
> I get the ERROR:  copy: line 1, Bad timestamp external representation ''
>
> why?  please help
>
> Pam Wampler
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (OpenBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE8csNNfexLsowstzcRAr7RAJ9EsknColO6M8Vt4cUIG6yUkA3W+QCg6plq
ojlpvIrKD8dht3werv9nYNs=
=/eQ4
-----END PGP SIGNATURE-----