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 <[email protected]> Discussion: https://www.postgresql.org/message-id/CA+fm-RPD0m9QL8W+804SGBBxn5iFz5wn=kncap9skm-s4pu...@mail.gmail.com Backpatch-through: 14 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f1ba2b826c52ab6e593d5d25c15dbde9d417f386 Modified Files -------------- src/backend/catalog/objectaddress.c | 13 +++++++----- src/backend/utils/adt/xml.c | 40 ++++++++++++++++++++++++++++++------- 2 files changed, 41 insertions(+), 12 deletions(-)
