pgsql: Fix pg_blocking_pids() for relation extension locks.

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix pg_blocking_pids() for relation extension locks.
Date: 2026-10-05 19:52:47
Message-ID: E1xDojv-00000000SIG-2Ny3@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix pg_blocking_pids() for relation extension locks.

pg_blocking_pids() assumes that members of the same lock group
never block each other, but that hasn't been true for relation
extension locks since v13. This commit teaches the function to
report lock group members as blockers for relation extension locks.
Since parallel workers are reported with their leader's PID, the
result may now include the blocked session's own PID.

Oversight in commit 85f6b49c2c.

Author: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Reviewed-by: Shihao Zhong <zhong950419(at)gmail(dot)com>
Discussion: https://postgr.es/m/apTpV8h%2BCYHf%2B1PJ%40bdtpg
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e7ef2cf256cc135da018899202d7c4ce167e0699

Modified Files
--------------
doc/src/sgml/func/func-info.sgml | 21 ++++++++++++++-------
src/backend/utils/adt/lockfuncs.c | 10 ++++++++--
2 files changed, 22 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-10-05 22:33:34 pgsql: Fix "SELECT simple_expression INTO" for expression becoming non-
Previous Message Tom Lane 2026-10-05 19:45:52 pgsql: Handle operator-stack-overflow errors softly in tsquery and ltxt