]> granicus.if.org Git - postgresql/commit
Keep track of transaction commit timestamps
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 3 Dec 2014 14:53:02 +0000 (11:53 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 3 Dec 2014 14:53:02 +0000 (11:53 -0300)
commit73c986adde5d73a5e2555da9b5c8facedb146dcd
tree29ee4f6c800c3614cfd3316c7026e30e552e12a4
parent6597ec9be6a9ed50390f73235d6654ec32a0b944
Keep track of transaction commit timestamps

Transactions can now set their commit timestamp directly as they commit,
or an external transaction commit timestamp can be fed from an outside
system using the new function TransactionTreeSetCommitTsData().  This
data is crash-safe, and truncated at Xid freeze point, same as pg_clog.

This module is disabled by default because it causes a performance hit,
but can be enabled in postgresql.conf requiring only a server restart.

A new test in src/test/modules is included.

Catalog version bumped due to the new subdirectory within PGDATA and a
couple of new SQL functions.

Authors: Álvaro Herrera and Petr Jelínek

Reviewed to varying degrees by Michael Paquier, Andres Freund, Robert
Haas, Amit Kapila, Fujii Masao, Jaime Casanova, Simon Riggs, Steven
Singer, Peter Eisentraut
43 files changed:
contrib/pg_upgrade/pg_upgrade.c
contrib/pg_xlogdump/rmgrdesc.c
doc/src/sgml/config.sgml
doc/src/sgml/func.sgml
doc/src/sgml/ref/pg_resetxlog.sgml
doc/src/sgml/storage.sgml
src/backend/access/rmgrdesc/Makefile
src/backend/access/rmgrdesc/committsdesc.c [new file with mode: 0644]
src/backend/access/rmgrdesc/xlogdesc.c
src/backend/access/transam/Makefile
src/backend/access/transam/README
src/backend/access/transam/commit_ts.c [new file with mode: 0644]
src/backend/access/transam/rmgr.c
src/backend/access/transam/slru.c
src/backend/access/transam/varsup.c
src/backend/access/transam/xact.c
src/backend/access/transam/xlog.c
src/backend/commands/vacuum.c
src/backend/libpq/hba.c
src/backend/replication/logical/decode.c
src/backend/storage/ipc/ipci.c
src/backend/storage/lmgr/lwlock.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample
src/bin/initdb/initdb.c
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_resetxlog/pg_resetxlog.c
src/include/access/commit_ts.h [new file with mode: 0644]
src/include/access/rmgrlist.h
src/include/access/transam.h
src/include/access/xlog_internal.h
src/include/catalog/catversion.h
src/include/catalog/pg_control.h
src/include/catalog/pg_proc.h
src/include/storage/lwlock.h
src/include/utils/builtins.h
src/test/modules/Makefile
src/test/modules/commit_ts/.gitignore [new file with mode: 0644]
src/test/modules/commit_ts/Makefile [new file with mode: 0644]
src/test/modules/commit_ts/commit_ts.conf [new file with mode: 0644]
src/test/modules/commit_ts/expected/commit_timestamp.out [new file with mode: 0644]
src/test/modules/commit_ts/expected/commit_timestamp_1.out [new file with mode: 0644]
src/test/modules/commit_ts/sql/commit_timestamp.sql [new file with mode: 0644]