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_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/275ad2006df5750e0c7c836f9d48ce2743389d7a Modified Files -------------- src/backend/catalog/objectaddress.c | 13 +++++++----- src/backend/utils/adt/xml.c | 40 ++++++++++++++++++++++++++++++------- 2 files changed, 41 insertions(+), 12 deletions(-)
