Handling NULL dates in "copy from" statement

Поиск
Список
Период
Сортировка
От Tim Nelson
Тема Handling NULL dates in "copy from" statement
Дата
Msg-id N52R7.630$vK1.49112@newsread2.prod.itd.earthlink.net
обсуждение исходный текст
Ответы Re: Handling NULL dates in "copy from" statement  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
Re: Handling NULL dates in "copy from" statement  (Jason Earl <jason.earl@simplot.com>)
Список pgsql-general
Is there a way to handle NULL date fields
that I am trying to import from another database?

ex:

...for a table with a single date field that allows NULL...

echo "12/31/2000" | psql -c "copy date_tab from stdin using delimiters '|' "
db_name

...works, but if I use a blank date...

echo "" | psql -c "copy date_tab from stdin using delimiters '|' " db_name

...it fails with "Bad date external representation"...

I've tried replacing the empty string with "NULL" and adding " with null as
'' " to no avail.

Any ideas?  Thanks.  Tim



В списке pgsql-general по дате отправления:

Предыдущее
От: "Andy Marden"
Дата:
Сообщение: Re: Casting Varchar to Numeric
Следующее
От: "Ligia Pimentel"
Дата:
Сообщение: How to rename a database