From c599a247bbe55a29737c78e122b77de34c8bf917 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 9 Dec 2005 01:22:04 +0000 Subject: Simplify lock manager data structures by making a clear separation between the data defining the semantics of a lock method (ie, conflict resolution table and ancillary data, which is all constant) and the hash tables storing the current state. The only thing we give up by this is the ability to use separate hashtables for different lock methods, but there is no need for that anyway. Put some extra fields into the LockMethod definition structs to clean up some other uglinesses, like hard-wired tests for DEFAULT_LOCKMETHOD and USER_LOCKMETHOD. This commit doesn't do anything about the performance issues we were discussing, but it clears away some of the underbrush that's in the way of fixing that. --- src/backend/utils/adt/lockfuncs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/lockfuncs.c') diff --git a/src/backend/utils/adt/lockfuncs.c b/src/backend/utils/adt/lockfuncs.c index bf7ee788c42..368822d3934 100644 --- a/src/backend/utils/adt/lockfuncs.c +++ b/src/backend/utils/adt/lockfuncs.c @@ -6,7 +6,7 @@ * Copyright (c) 2002-2005, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/lockfuncs.c,v 1.20 2005/10/15 02:49:28 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/lockfuncs.c,v 1.21 2005/12/09 01:22:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -256,7 +256,8 @@ pg_lock_status(PG_FUNCTION_ARGS) else nulls[10] = 'n'; values[11] = DirectFunctionCall1(textin, - CStringGetDatum(GetLockmodeName(mode))); + CStringGetDatum(GetLockmodeName(LOCK_LOCKMETHOD(*lock), + mode))); values[12] = BoolGetDatum(granted); tuple = heap_formtuple(funcctx->tuple_desc, values, nulls); -- cgit v1.2.3