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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Дата
Msg-id 20964.1045544661@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...  (Dennis Gearon <gearond@cvc.net>)
Список pgsql-general
Dennis Gearon <gearond@cvc.net> writes:
> So, will this work correctly? ( I am still waiting for SSH
> access to my site to play with Postgres ):
> create table test_timestamp(
> created timestamp DEFAULT CURRENT_TIMESTAMP::timestamptz NOT NULL
> );

I think you want

created timestamptz DEFAULT CURRENT_TIMESTAMP NOT NULL

CURRENT_TIMESTAMP is already timestamptz, you need not cast it.  But you
do want the column to be type timestamptz not timestamp.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Index not used with IS NULL
Следующее
От: Sean Chittenden
Дата:
Сообщение: Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...