Postgresql 创建 Table Fieldname Timestamp with Time Zone UTC

Postgresql Create Table Fieldname Timestamp with Time Zone UTC

创建带有 UTC 时区字段的 table 的语法是什么?

我有以下字段:

(id INT PRIMARY KEY NOT NULL, 
 bravo timestamp without time zone DEFAULT now(),
 charlie timestamp with time zone UTC DEFAULT now()
)

最后一个名为 charlie 的字段由于某种原因没有使用。我希望这很简单,只需告诉它有一个时区,然后将 UTC 推到那里,并让数据库在输入过程中计算出 now()

我想你想要这个:

charlie timestamp without time zone NOT NULL
   DEFAULT (current_timestamp AT TIME ZONE 'UTC')