是否有 CURRENT_TIMESTAMP 没有时区的替代方案?

Is there an alternative to CURRENT_TIMESTAMP with no timezone?

我需要存储一行被插入 table 的日期,到目前为止我有这个:

CREATE TABLE mytable (
    inserted_on timestampz DEFAULT CURRENT_TIMESTAMP
);

这行得通,但实际上我不需要时区(timestampz 包含)。 CURRENT_TIMESTAMP 有没有 return 时区的替代方法?

我认为您正在寻找 localtimestamp。数据类型为timestamp without timezone:

 select localtimestamp, pg_typeof(localtimestamp)