Обсуждение: Newbie: Copy from and dates

Поиск
Список
Период
Сортировка

Newbie: Copy from and dates

От
pete@gui-innovations.com (Pete Vickers)
Дата:
Hi,
I am trying to import a flat file into a database, where the dates may
or may not be present. Have tried specifying the column as null, or
default null, but if I try to import an empty date, it fails.
Is there a way round this please

TIA

Pete

Re: Newbie: Copy from and dates

От
Martijn van Oosterhout
Дата:
On Sun, Mar 10, 2002 at 12:53:48PM -0800, Pete Vickers wrote:
> Hi,
> I am trying to import a flat file into a database, where the dates may
> or may not be present. Have tried specifying the column as null, or
> default null, but if I try to import an empty date, it fails.
> Is there a way round this please

If you're using COPY, then "\N" represents a null value. You can also
specify what is a null in the copy command itself IIRC.

--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> 11/9/2001 - a new beginning or the beginning of the end?