Re: I was spoiled by the MySQL timestamp field

Поиск
Список
Период
Сортировка
От Björn Metzdorf
Тема Re: I was spoiled by the MySQL timestamp field
Дата
Msg-id 026101c2c2db$7256c230$81c206d4@office.turtleentertainment.de
обсуждение исходный текст
Ответ на Re: tsearch comments  (Oleg Bartunov <oleg@sai.msu.su>)
Ответы Re: I was spoiled by the MySQL timestamp field  ("Matthew Nuzum" <cobalt@bearfruit.org>)
Список pgsql-general
> As someone who is just getting started with PostygreSQL from years working
> with MySQL, it appears that the timestamp data type does not behave in the
> way it did with MySQL. I got used to just defining a column as a timestamp
> and letting the database throw the latest time stamp in there whenever a
row
> was updated. Is there anything simular in PosgreSQL? How can I accomplish
> something simular inside the database, or am I stuck populating the field
in
> some manner as in the following example

There is no such datatype in postgresql. If you just need the current time
inserted on INSERT and not on UPDATE, then you can declare that column with
"default now()". Else you will need to install a trigger, then you can have
exactly the same behaviour as with mysql.

Regards,
Bjoern


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

Предыдущее
От: "Alan T. Miller"
Дата:
Сообщение: I was spoiled by the MySQL timestamp field
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: HOW-TO do incomplete dates: year, optional month, optional day?