create column for auto-date in postgresql

回眸只為那壹抹淺笑 提交于 2021-02-18 11:56:10

问题


I know that to create a column in mysql is like this

 'date' timestamp not null default CURRENT_TIMESTAMP, 

  how to postgresql?


回答1:


It's the same, you just have to fix the identifier quoting to use SQL standard "identifer quoting":

 "date" timestamp not null default CURRENT_TIMESTAMP, 

but really, you should not use "date" as an identifier.



来源:https://stackoverflow.com/questions/23518399/create-column-for-auto-date-in-postgresql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!