Обсуждение: Re: three timestamps/table, use of 'now' in table creation statement

Поиск
Список
Период
Сортировка

Re: three timestamps/table, use of 'now' in table creation statement

От
Bruno Wolff III
Дата:
On Thu, Jan 16, 2003 at 13:00:44 -0800,
  Dennis Gearon <gearond@cvc.net> wrote:
> What would it be rounded to, for the sake of knowledge?
>
> I will change all my table defintions to timestamp(0). BTW, what is the default resolution? I'm am
> in the process of RTFM'ing, don't worry.

I was just pointing out that there might be a difference between the two
cases. If you don't care about rounding, you can just use current_timestamp
instead of current_timestamp(0).

Re: three timestamps/table, use of 'now' in table creation statement

От
Dennis Gearon
Дата:
What would it be rounded to, for the sake of knowledge?

I will change all my table defintions to timestamp(0). BTW, what is the default resolution? I'm am
in the process of RTFM'ing, don't worry.

1/16/2003 12:48:06 PM, Bruno Wolff III <bruno@wolff.to> wrote:

>Note you seem to have forgotten to cc the list on this message.
>
>On Thu, Jan 16, 2003 at 09:42:10 -0800,
>  Dennis Gearon <gearond@cvc.net> wrote:
>> Thank you for all the replies, I now have half of my question answered. What I need to know is
>> what I can put in the table definition for the default value to have the current timestamp put
in
>> the three timestamp fields.
>>
>> 1/ Can I put 'now' as the default value
>>     in the table definition?
>>
>> 2/ can I put CURRENT_TIMESTAMP(0) as the default value ...
>>     in the table definition?
>
>I believe both of these will work. If the column is of type timestamp
>(as opposed to timestamp(0)) then 'now''s value won't be rounded to
>the nearest second.
>