Re: Bad timestamp 7.1->7.2

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bad timestamp 7.1->7.2
Дата
Msg-id 17922.1014400150@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bad timestamp 7.1->7.2  (Doug Needham <dneedham@pbo.net>)
Список pgsql-admin
Doug Needham <dneedham@pbo.net> writes:
> I created a database on postgres 7.1
> one of the fields was defined with a default of :
> 'select now()::"timestamp"
> When I try to create this table under 7.2 it fails.

Hmm, looks fine to me:

regression=# create table foobar (f1 timestamp default now()::"timestamp");
CREATE
regression=# insert into foobar default values;
INSERT 401822 1
regression=# select * from foobar;
              f1
-------------------------------
 2002-02-22 12:45:39.189714-05
(1 row)

Could you be more exact in your description of what you entered and what
problem you saw?

Personally I'd just say "default now()", or "default current_timestamp"
if I wanted to be SQL92-correct, but the cast should be okay too.

            regards, tom lane

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Client Authentication
Следующее
От: "Gaetano Mendola"
Дата:
Сообщение: Re: Builded Postgresql 7.2 for Redhat 7.1