summaryrefslogtreecommitdiff
path: root/src/backend/storage/lmgr
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-01-08 23:18:51 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-01-08 23:18:51 +0000
commitda3df47c84023ac0d65c5fae97abe2b42cef7e29 (patch)
tree7e83471bd1ca383552dfb2169afcde97cb52337c /src/backend/storage/lmgr
parentbbd3bdba3e453d537f13524e3c265771066b748b (diff)
downloadpostgresql-da3df47c84023ac0d65c5fae97abe2b42cef7e29.tar.gz
lmgr.c:DescribeLockTag was never taught about virtual xids, per Greg Stark.
Also a couple of minor tweaks to try to future-proof the code a bit better against future locktag additions.
Diffstat (limited to 'src/backend/storage/lmgr')
-rw-r--r--src/backend/storage/lmgr/lmgr.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/backend/storage/lmgr/lmgr.c b/src/backend/storage/lmgr/lmgr.c
index 2b0d21adbf..a882f4e432 100644
--- a/src/backend/storage/lmgr/lmgr.c
+++ b/src/backend/storage/lmgr/lmgr.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/lmgr/lmgr.c,v 1.95 2008/01/01 19:45:52 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/lmgr/lmgr.c,v 1.96 2008/01/08 23:18:50 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -672,7 +672,7 @@ UnlockSharedObject(Oid classid, Oid objid, uint16 objsubid,
bool
LockTagIsTemp(const LOCKTAG *tag)
{
- switch (tag->locktag_type)
+ switch ((LockTagType) tag->locktag_type)
{
case LOCKTAG_RELATION:
case LOCKTAG_RELATION_EXTEND:
@@ -686,6 +686,7 @@ LockTagIsTemp(const LOCKTAG *tag)
return true;
break;
case LOCKTAG_TRANSACTION:
+ case LOCKTAG_VIRTUALTRANSACTION:
/* there are no temp transactions */
break;
case LOCKTAG_OBJECT:
@@ -710,7 +711,7 @@ LockTagIsTemp(const LOCKTAG *tag)
void
DescribeLockTag(StringInfo buf, const LOCKTAG *tag)
{
- switch (tag->locktag_type)
+ switch ((LockTagType) tag->locktag_type)
{
case LOCKTAG_RELATION:
appendStringInfo(buf,
@@ -744,6 +745,12 @@ DescribeLockTag(StringInfo buf, const LOCKTAG *tag)
_("transaction %u"),
tag->locktag_field1);
break;
+ case LOCKTAG_VIRTUALTRANSACTION:
+ appendStringInfo(buf,
+ _("virtual transaction %d/%u"),
+ tag->locktag_field1,
+ tag->locktag_field2);
+ break;
case LOCKTAG_OBJECT:
appendStringInfo(buf,
_("object %u of class %u of database %u"),
@@ -770,7 +777,7 @@ DescribeLockTag(StringInfo buf, const LOCKTAG *tag)
default:
appendStringInfo(buf,
_("unrecognized locktag type %d"),
- tag->locktag_type);
+ (int) tag->locktag_type);
break;
}
}