From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix two crashes on a concurrently dropped schema
Date: Sat, 31 Oct 2026 11:47:29 +0000
Message-ID: <E1xN7YX-00000001WzW-0d8J@gemulon.postgresql.org> (raw)
Fix two crashes on a concurrently dropped schema
pg_identify_object() looks up the object's schema name without a lock
on the schema, so a concurrent DROP SCHEMA can make get_namespace_name()
return NULL, which was then passed to quote_identifier(). Report the
schema as NULL instead, as is already done for objects that have gone
away.
Similarly, schema_to_xml() and the related SQL/XML functions look up
the schema name without a lock on the schema, and a concurrent DROP
SCHEMA can make get_namespace_name() return NULL, which was then
dereferenced. Report that the schema does not exist, or skip it when
mapping all schemas of the database.
Author: Baji Shaik <baji.pgdev@gmail.com>
Discussion: https://www.postgresql.org/message-id/CA+fm-RPD0m9QL8W+804SGBBxn5iFz5wn=kncaP9SkM-s4PUANw@mail.gmail...
Backpatch-through: 14
Branch
------
REL_16_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/a2732c98671d86a06f7ec21d469a52a7bf4efdc9
Modified Files
--------------
src/backend/catalog/objectaddress.c | 13 +++++++-----
src/backend/utils/adt/xml.c | 40 ++++++++++++++++++++++++++++++-------
2 files changed, 41 insertions(+), 12 deletions(-)
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-committers@postgresql.org
Cc: heikki.linnakangas@iki.fi
Subject: Re: pgsql: Fix two crashes on a concurrently dropped schema
In-Reply-To: <E1xN7YX-00000001WzW-0d8J@gemulon.postgresql.org>
References: <E1xN7YX-00000001WzW-0d8J@gemulon.postgresql.org>
* 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