Comment ajouter une colonne entière avec la valeur par défaut de timestamp unix (epoch) dans PostgreSQL?

StackOverflow https://stackoverflow.com/questions/1012301

  •  06-07-2019
  •  | 
  •  

Question

Cela ne fonctionne pas:

create table event (
...
time int default date_part('epoch', timestamp 'now'),
...
);
Était-ce utile?

La solution

Je ne suis pas un expert en postgresql, mais cela ne devrait-il pas fonctionner

time int default date_part('epoch', now())
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top