将表列更改为时间戳now()属性

希克尔

我使用在互联网上找到的样本在postgres中创建了一个表格。该列的定义stored是:

stored  | timestamp without time zone | default '2014-04-11 21:19:20.144487'::timestamp without time zone

如何将其更改为now()类型的“正常”时间戳?因此,在插入数据时会标记当前日期时间吗?

谢谢大家!

迈克·谢里尔(Mike Sherrill)的“猫召回”

如果您要更改默认值

alter table your-table-name
alter column stored set default current_timestamp

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章