Re: I was spoiled by the MySQL timestamp field - Mailing list pgsql-general

From Björn Metzdorf
Subject Re: I was spoiled by the MySQL timestamp field
Date
Msg-id 026101c2c2db$7256c230$81c206d4@office.turtleentertainment.de
Whole thread Raw
In response to Re: tsearch comments  (Oleg Bartunov <oleg@sai.msu.su>)
Responses Re: I was spoiled by the MySQL timestamp field
List 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 by date:

Previous
From: "Alan T. Miller"
Date:
Subject: I was spoiled by the MySQL timestamp field
Next
From: Bruno Wolff III
Date:
Subject: Re: HOW-TO do incomplete dates: year, optional month, optional day?