Re: How do I make a timestamp column default to current time

Поиск
Список
Период
Сортировка
От John D. Burger
Тема Re: How do I make a timestamp column default to current time
Дата
Msg-id e54617506699a152613f93922789c4f8@mitre.org
обсуждение исходный текст
Ответ на Re: How do I make a timestamp column default to current time  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: How do I make a timestamp column default to current time  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane writes:

> Try
>
>     mycol timestamp default now()
> or
>     mycol timestamp default current_timestamp
>
> (the latter is actually a function call, even though the SQL standard
> says it has to be spelled without any parentheses)

And both of these return start time of the current transaction, yes?
Is it the case that there is no SQL-standard way to get the current
time?  I know Postgresql has timeofday(), but it's not standard (plus
it's weird that it returns a text string).

- John D. Burger
   MITRE


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

Предыдущее
От: Philip Hallstrom
Дата:
Сообщение: Re: Replication & web apps
Следующее
От: Robert Treat
Дата:
Сообщение: Re: PostgreSQL scalability concerns