From a8d1075f271458960da683e8ec28f5a656984159 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 18 Jun 2005 19:33:42 +0000 Subject: Add a time-of-preparation column to the pg_prepared_xacts view, per an old suggestion by Oliver Jowett. Also, add a transaction column to the pg_locks view to show the xid of each transaction holding or awaiting locks; this allows prepared transactions to be properly associated with the locks they own. There was already a column named 'transaction', and I chose to rename it to 'transactionid' --- since this column is new in the current devel cycle there should be no backwards compatibility issue to worry about. --- src/include/access/twophase.h | 10 ++++++---- src/include/catalog/catversion.h | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/include') diff --git a/src/include/access/twophase.h b/src/include/access/twophase.h index ac2e05f33c..d7c64f2b12 100644 --- a/src/include/access/twophase.h +++ b/src/include/access/twophase.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/twophase.h,v 1.1 2005/06/17 22:32:48 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/twophase.h,v 1.2 2005/06/18 19:33:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -15,6 +15,7 @@ #define TWOPHASE_H #include "storage/lock.h" +#include "utils/timestamp.h" /* @@ -31,8 +32,9 @@ extern void TwoPhaseShmemInit(void); extern PGPROC *TwoPhaseGetDummyProc(TransactionId xid); -extern GlobalTransaction MarkAsPreparing(TransactionId xid, Oid databaseid, - char *gid, AclId owner); +extern GlobalTransaction MarkAsPreparing(TransactionId xid, const char *gid, + TimestampTz prepared_at, + AclId owner, Oid databaseid); extern void MarkAsPrepared(GlobalTransaction gxact); extern void StartPrepare(GlobalTransaction gxact); @@ -44,6 +46,6 @@ extern void RecoverPreparedTransactions(void); extern void RecreateTwoPhaseFile(TransactionId xid, void *content, int len); extern void RemoveTwoPhaseFile(TransactionId xid, bool giveWarning); -extern void FinishPreparedTransaction(char *gid, bool isCommit); +extern void FinishPreparedTransaction(const char *gid, bool isCommit); #endif /* TWOPHASE_H */ diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index de422a41a9..bdbaa83ace 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.277 2005/06/17 22:32:48 tgl Exp $ + * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.278 2005/06/18 19:33:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200506171 +#define CATALOG_VERSION_NO 200506181 #endif -- cgit v1.2.1