在postgresql中为auto-date创建列

时间:2014-05-07 12:53:25

标签: postgresql

我知道在mysql中创建一个列就像这样

 'date' timestamp not null default CURRENT_TIMESTAMP, 

如何postgresql?

1 个答案:

答案 0 :(得分:8)

它是相同的,您只需要修改标识符引用以使用SQL标准"identifer quoting"

 "date" timestamp not null default CURRENT_TIMESTAMP, 

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