How to add integer column with default of unix timestamp (epoch) in PostgreSQL?
-
06-07-2019 - |
Question
This doesn't work:
create table event (
...
time int default date_part('epoch', timestamp 'now'),
...
);
Solution
I'm no postgresql expert but shouldn't this one work
time int default date_part('epoch', now())
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow