Re: Timestamp Default value

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Timestamp Default value
Дата
Msg-id 14400.1082574208@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Timestamp Default value  ("Christopher A. Goodfellow" <cgoodfellow@tealuxe.com>)
Список pgsql-novice
"Christopher A. Goodfellow" <cgoodfellow@tealuxe.com> writes:
> I created a table with column named orderdate and a default of Now() by the
> following command:

> CREATE TABLE "trans_test" (
>     "orderdate" timestamp without time zone DEFAULT timestamp 'now ( )' NOT
> NULL,

That should just be
    ... DEFAULT now() ...
or if you want to be SQL spec compliant
    ... DEFAULT LOCALTIMESTAMP ...

What you have is a timestamp literal that is parsed at the instant of
table creation.  The parentheses are perhaps misleading you into
thinking that you have written a function call, but you haven't ---
the timestamp input converter is just ignoring them.

            regards, tom lane

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

Предыдущее
От: Michael Guerin
Дата:
Сообщение: Re: vacuum full question.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: vacuum full question.