aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/guc.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2014-12-03 11:53:02 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2014-12-03 11:53:02 -0300
commit73c986adde5d73a5e2555da9b5c8facedb146dcd (patch)
tree29ee4f6c800c3614cfd3316c7026e30e552e12a4 /src/backend/utils/misc/guc.c
parent6597ec9be6a9ed50390f73235d6654ec32a0b944 (diff)
downloadpostgresql-73c986adde5d73a5e2555da9b5c8facedb146dcd.tar.gz
postgresql-73c986adde5d73a5e2555da9b5c8facedb146dcd.zip
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
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r--src/backend/utils/misc/guc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index d4d74baedbc..b1bff7f3500 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -26,6 +26,7 @@
#include <syslog.h>
#endif
+#include "access/commit_ts.h"
#include "access/gin.h"
#include "access/transam.h"
#include "access/twophase.h"
@@ -836,6 +837,15 @@ static struct config_bool ConfigureNamesBool[] =
check_bonjour, NULL, NULL
},
{
+ {"track_commit_timestamp", PGC_POSTMASTER, REPLICATION,
+ gettext_noop("Collects transaction commit time."),
+ NULL
+ },
+ &track_commit_timestamp,
+ false,
+ NULL, NULL, NULL
+ },
+ {
{"ssl", PGC_POSTMASTER, CONN_AUTH_SECURITY,
gettext_noop("Enables SSL connections."),
NULL