Re: Automatic date/time

Поиск
Список
Период
Сортировка
От John Christopher
Тема Re: Automatic date/time
Дата
Msg-id dv3sid$7p0$1@sea.gmane.org
обсуждение исходный текст
Ответ на Automatic date/time  (Joao Miguel Ferreira <jmf@estg.ipvc.pt>)
Ответы Re: Automatic date/time
Re: Automatic date/time
Список pgsql-novice
Hello,
To follow up on that, how to make sure the timestamp is always stored and
displayed at, for instance, time zone 'zulu'
Something like
create table ...
{
   datetime timestamptz default 'now() at time zone \'zulu\''
}
does not work; PostgreSQL complains about the syntax. Any idea.
Many thanks
JCR

"Sean Davis" <sdavis2@mail.nih.gov> wrote in message
news:C03AC283.7E86%sdavis2@mail.nih.gov...
>
>
>
> On 3/13/06 6:19 AM, "Joao Miguel Ferreira" <jmf@estg.ipvc.pt> wrote:
>
>> Hello all,
>>
>> is it possible to have Pg automatically insert a Date or Time value on a
>> record if the INSERT comand does not include one ?
>>
>> Something similar to AUTO INCREMENT for INTs ?!?!
>>
>> This way the program that does the INSERT wouldn't have to worry about
>> the correct Date/Time value nor format....
>
> Look at setting defaults and set the default to something like 'now()'.
>
> Create table .... (
>
>    mydate date default 'now()',
>
> );
>
> Sean
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
>



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

Предыдущее
От: Sean Davis
Дата:
Сообщение: Re: Automatic date/time
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: Automatic date/time