*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
bool
LockTagIsTemp(const LOCKTAG *tag)
{
- switch (tag->locktag_type)
+ switch ((LockTagType) tag->locktag_type)
{
case LOCKTAG_RELATION:
case LOCKTAG_RELATION_EXTEND:
return true;
break;
case LOCKTAG_TRANSACTION:
+ case LOCKTAG_VIRTUALTRANSACTION:
/* there are no temp transactions */
break;
case LOCKTAG_OBJECT:
void
DescribeLockTag(StringInfo buf, const LOCKTAG *tag)
{
- switch (tag->locktag_type)
+ switch ((LockTagType) tag->locktag_type)
{
case LOCKTAG_RELATION:
appendStringInfo(buf,
_("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"),
default:
appendStringInfo(buf,
_("unrecognized locktag type %d"),
- tag->locktag_type);
+ (int) tag->locktag_type);
break;
}
}
* Copyright (c) 2002-2008, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/lockfuncs.c,v 1.31 2008/01/01 19:45:52 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/lockfuncs.c,v 1.32 2008/01/08 23:18:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
MemSet(values, 0, sizeof(values));
MemSet(nulls, ' ', sizeof(nulls));
- if (lock->tag.locktag_type <= LOCKTAG_ADVISORY)
+ if (lock->tag.locktag_type <= LOCKTAG_LAST_TYPE)
locktypename = LockTagTypeNames[lock->tag.locktag_type];
else
{
values[0] = DirectFunctionCall1(textin,
CStringGetDatum(locktypename));
- switch (lock->tag.locktag_type)
+ switch ((LockTagType) lock->tag.locktag_type)
{
case LOCKTAG_RELATION:
case LOCKTAG_RELATION_EXTEND:
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/lock.h,v 1.111 2008/01/01 19:45:59 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/storage/lock.h,v 1.112 2008/01/08 23:18:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
LOCKTAG_ADVISORY /* advisory user locks */
} LockTagType;
+#define LOCKTAG_LAST_TYPE LOCKTAG_ADVISORY
+
/*
* The LOCKTAG struct is defined with malice aforethought to fit into 16
* bytes with no padding. Note that this would need adjustment if we were