Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...

Поиск
Список
Период
Сортировка
От Sean Chittenden
Тема Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Дата
Msg-id 20030218050502.GF79234@perrin.int.nxad.com
обсуждение исходный текст
Ответ на Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...  (Dennis Gearon <gearond@cvc.net>)
Ответы Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Список pgsql-general
> create table test_timestamp(
> created timestamp DEFAULT CURRENT_TIMESTAMP::timestamptz NOT NULL
> );

Don't take chances:

CREATE TABLE test (
       created TIMESTAMP WITHOUT TIME ZONE DEFAULT 'CURRENT_TIMESTAMP' NOT NULL
);

iirc, you have to put quotes around CURRENT_TIMESTAMP otherwise the
default value is set to the CURRENT_TIMESTAMP at this very instant
instead of being evaluated at runtime when a record is inserted.  -sc

--
Sean Chittenden

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Следующее
От: Dennis Gearon
Дата:
Сообщение: Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...