在postgresql中创建自动日期列

在postgresql中创建自动日期列,postgresql,Postgresql,我知道在mysql中创建列是这样的 'date' timestamp not null default CURRENT_TIMESTAMP, 如何postgresql?同样,您只需修复标识符引用即可使用SQL标准“identifer quoting”: 但实际上,您不应该使用“date”作为标识符。到目前为止您尝试了什么?如果你得到了一条错误消息,你得到了什么?除了列名的无效标识符之外,我觉得还可以;要引用标识符,您需要“双引号”:“date”timestamp not null默认当前\

我知道在mysql中创建列是这样的

 'date' timestamp not null default CURRENT_TIMESTAMP, 

如何postgresql?

同样,您只需修复标识符引用即可使用SQL标准
“identifer quoting”


但实际上,您不应该使用
“date”
作为标识符。

到目前为止您尝试了什么?如果你得到了一条错误消息,你得到了什么?除了列名的无效标识符之外,我觉得还可以;要引用标识符,您需要“双引号”:
“date”timestamp not null默认当前\u timestamp
(或为您的列指定一个非保留名称)。
 "date" timestamp not null default CURRENT_TIMESTAMP,