Re: Date data type

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: Date data type
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C202ACEFD8@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на Date data type  (Mike Hall <MHall@astc.nt.gov.au>)
Список pgsql-general
Mike Hall wrote:
> I'm currently converting an MS Access database to PostgreSQL
> (version 8.1 as it is the vesion that ships with CentOS 5).
>
> I'm having trouble with an INSERT statement attempting to
> insert an empty value ('') into a field with data type DATE.
> This produces the following error message:
>
> ERROR: invalid input syntax for type date: ""
>
> It does the same whether the field has a NOT NULL restraint or not.
>
> I can't find anything relevant in the documentation.
>
> What am I doing wrong.

An empty string is not a NULL value.
An empty string cannot be converted to a valid date.

Use NULL instead of '' to insert a NULL value.

Yours,
Laurenz Albe

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

Предыдущее
От: Rainer Bauer
Дата:
Сообщение: Re: Cannot remember what to do to get the information_schema, pg_catalog etc showing.
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Date data type