如何在psql中开启track_commit_timestamp

How to turn on track_commit_timestamp in psql

https://www.postgresql.org/docs/current/runtime-config-replication.html#GUC-TRACK-COMMIT-TIMESTAMP

track_commit_timestamp (boolean) Record commit time of transactions.
This parameter can only be set in postgresql.conf file or on the server command line. The default value is off.

show track_commit_timestamp; return 关闭。
如何在psql中开启?

您可以使用 ALTER SYSTEM 作为超级用户:

ALTER SYSTEM SET track_commit_timestamp = on;

这相当于改变postgresql.conf

您必须重新启动 PostgreSQL 才能使新设置生效。