Re: [GENERAL] Empty Date Field

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: [GENERAL] Empty Date Field
Дата
Msg-id 199905091838.TAA00474@linda.lfix.co.uk
обсуждение исходный текст
Ответ на Empty Date Field  ("fabian baena" <fabbaena@hotmail.com>)
Список pgsql-general
"fabian baena" wrote:
  >Hi, could any one tell me how can I tell postgres that a date field I made
  >in a table can be empty.
  >
  >I created a table with a field like that but I didn't tell it "not null" in
  >the declaration, and when I try to fill this table with an empty date it
  >gives me an error.

If you don't mention the field in an update or insert, it will automatically
be null.  You can't fill it with the empty string.  You can specifically
make it null:

insert into tablex (dtfield) values (null);

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "Therefore, my beloved brethren, be ye stedfast,
      unmoveable, always abounding in the work of the Lord,
      forasmuch as ye know that your labor is not in vain
      in the Lord."      I Corinthians 15:58



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

Предыдущее
От: "fabian baena"
Дата:
Сообщение: Empty Date Field
Следующее
От: "fabian baena"
Дата:
Сообщение: Re: [GENERAL] Empty Date Field