Re: [SQL] CURRENT_TIMSTAMP

Поиск
Список
Период
Сортировка
От Joel Burton
Тема Re: [SQL] CURRENT_TIMSTAMP
Дата
Msg-id 20021202183827.GB12953@temp.joelburton.com
обсуждение исходный текст
Список pgsql-admin
On Mon, Dec 02, 2002 at 11:41:33AM -0500, Raymond Chui wrote:
> I created a column, dada type timstamp with time zone
> and with default CURRENT_TIMSTAMP
> it shows me the default is
>
> default ('now'::text)::timstamp(6) with time zone
>
> Then when I insert a row, the default timestamp value is
>
> yyyy-mm-dd HH:MM:ss.mmmmm+00
>
> where mmmmm is milliseconds.
> How do I make default only yyyy-mm-dd HH:MM:ss+00 ?
> Thank Q!

The problem isn't CURRENT_TIMESTAMP, it's your table definition.
If you create the field as timestamp(0) [in 7.3, that's timestamp(0)
with time zone, since the default has swung to no-TZ], it will keep
track of just HMS. Or put in other values for 0 for more granularity on
seconds.

Of course, you can always store the specific time and select it out
w/less resolution (using the time/date functions). In some cases, this
might be a better solution.

- J.

--

Joel BURTON  |  joel@joelburton.com  |  joelburton.com  |  aim: wjoelburton
Independent Knowledge Management Consultant

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: How to setup a cluster of postgresql databases?
Следующее
От: "Nick Fankhauser"
Дата:
Сообщение: Re: pg_restore error: function plpgsql_call_handler already exists with same argument types