ALTER表列到timestamp now()属性

Shi*_*ker 2 postgresql timestamp

我在互联网上找到的样本中创建了一张表格.该列的定义stored是:

stored  | timestamp without time zone | default '2014-04-11 21:19:20.144487'::timestamp without time zone
Run Code Online (Sandbox Code Playgroud)

如何将此更改为"正常"时间戳now()类型?那么它会在插入数据时标记当前的日期时间?

谢谢大家!

Mik*_*ll' 6

如果您尝试更改默认值...

alter table your-table-name
alter column stored set default current_timestamp
Run Code Online (Sandbox Code Playgroud)