I don’t know why, but I like to work with Unix-timestamp. Maybe because I need to perform calculations with time like with number, e.g. time()-604800.
Right now I have integer column whereto I insert result of time(). I think it isn’t right way, is it? Is there a default value — unix timestamp?
You should get rid of the habit of using unix timestamps in your database. PostgreSQL has really awesome date functions such as
datetimecol - interval '1 week'. It can also easily convert to unix timestamps usingextract(epoch from datetimecol).Anyway, you can use
extract(epoch from now())as the default value of your column.