pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Subject: Use MaxLockMode in lock methods initialization
Date: Mon, 3 Jan 2022 14:47:22 +0800
Message-ID: <20220103064722.ewdv4evlez5m7mdn@jrouhaud> (raw)

Hi,

While reading some code around I noticed that b04aeb0a053e7 added a MaxLockMode
but didn't update the lock methods initialization.  It shouldn't make much
difference in the long run but some consistency seems better to me.

Attachments:

0001-Use-MaxLockMode-in-LockMethodData-initialization.patch (text/plain, 1.2K) download From 1a3de43f4ed75466413ffcd884678332960c2520 Mon Sep 17 00:00:00 2001 From: Julien Rouhaud <julien.rouhaud@free.fr> Date: Mon, 3 Jan 2022 12:19:11 +0800 Subject: [PATCH] Use MaxLockMode in LockMethodData initialization. Commit b04aeb0a053e7 added a MaxLockMode to hold the highest lock mode so let's use it here too. --- src/backend/storage/lmgr/lock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index c25af7fe09..2e985df5af 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -124,7 +124,7 @@ static bool Dummy_trace = false; #endif static const LockMethodData default_lockmethod = { - AccessExclusiveLock, /* highest valid lock mode number */ + MaxLockMode, /* highest valid lock mode number */ LockConflicts, lock_mode_names, #ifdef LOCK_DEBUG @@ -135,7 +135,7 @@ static const LockMethodData default_lockmethod = { }; static const LockMethodData user_lockmethod = { - AccessExclusiveLock, /* highest valid lock mode number */ + MaxLockMode, /* highest valid lock mode number */ LockConflicts, lock_mode_names, #ifdef LOCK_DEBUG -- 2.33.1

view thread (3+ messages)  latest in thread

Message-ID: <20220103064722.ewdv4evlez5m7mdn@jrouhaud>
Permalink:  ../20220103064722.ewdv4evlez5m7mdn@jrouhaud/
Also on:    postgresql.org/message-id/20220103064722.ewdv4evlez5m7mdn@jrouhaud

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: rjuju123@gmail.com
  Subject: Re: Use MaxLockMode in lock methods initialization
  In-Reply-To: <20220103064722.ewdv4evlez5m7mdn@jrouhaud>
  References: <20220103064722.ewdv4evlez5m7mdn@jrouhaud>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox