Re: BUG #15145: date time default value issues

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #15145: date time default value issues
Дата
Msg-id CAKFQuwYRO=7vSY-UbPg0xJ5G_P3s7C7sDTBmC53b1FiXZ6+kaw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #15145: date time default value issues  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: BUG #15145: date time default value issues  (Marko Tiikkaja <marko@joh.to>)
Список pgsql-bugs
On Friday, April 6, 2018, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Friday, April 6, 2018, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      15145
Logged by:          Paj Dib Xyooj
Email address:      dibxyooj96@gmail.com
PostgreSQL version: 9.4.5
Operating system:   (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit
Description:

i set column "document_datenow timestamp with time zone NOT NULL DEFAULT
now()"
but the values that like this "0001-12-31 23:42:04+06:42:04 BC"

What does typing "date" at your o/s command line show?


So, that a constant time is used is not unusual, it's documented.  Now() is a function that gets resolved at default creation.  You need to use "current_timestamp" literal special value if you want insertion time defaults.   But since you didn't create the table in BC with an odd time zone offset either you gave bad example or there is still something wrong in your environment.

David J.

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

Предыдущее
От: Takahiro Senda
Дата:
Сообщение: installer for windows by enterprisedb doesn't accpet some chars aspassword
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: BUG #15145: date time default value issues