summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/catalog/objectaddress.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index 27616ac2ad2..903879bc437 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -3305,6 +3305,12 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
initStringInfo(&opfam);
getOpFamilyDescription(&opfam, amopForm->amopfamily, false);
+ /*
+ * We use FORMAT_TYPE_ALLOW_INVALID here so as not to fail
+ * completely if the type links are dangling, which is a form
+ * of catalog corruption that could occur due to old bugs.
+ */
+
/*------
translator: %d is the operator strategy (a number), the
first two %s's are data type names, the third %s is the
@@ -3312,8 +3318,10 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
textual form of the operator with arguments. */
appendStringInfo(&buffer, _("operator %d (%s, %s) of %s: %s"),
amopForm->amopstrategy,
- format_type_be(amopForm->amoplefttype),
- format_type_be(amopForm->amoprighttype),
+ format_type_extended(amopForm->amoplefttype,
+ -1, FORMAT_TYPE_ALLOW_INVALID),
+ format_type_extended(amopForm->amoprighttype,
+ -1, FORMAT_TYPE_ALLOW_INVALID),
opfam.data,
format_operator(amopForm->amopopr));
@@ -3362,6 +3370,12 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
initStringInfo(&opfam);
getOpFamilyDescription(&opfam, amprocForm->amprocfamily, false);
+ /*
+ * We use FORMAT_TYPE_ALLOW_INVALID here so as not to fail
+ * completely if the type links are dangling, which is a form
+ * of catalog corruption that could occur due to old bugs.
+ */
+
/*------
translator: %d is the function number, the first two %s's
are data type names, the third %s is the description of the
@@ -3369,8 +3383,10 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
function with arguments. */
appendStringInfo(&buffer, _("function %d (%s, %s) of %s: %s"),
amprocForm->amprocnum,
- format_type_be(amprocForm->amproclefttype),
- format_type_be(amprocForm->amprocrighttype),
+ format_type_extended(amprocForm->amproclefttype,
+ -1, FORMAT_TYPE_ALLOW_INVALID),
+ format_type_extended(amprocForm->amprocrighttype,
+ -1, FORMAT_TYPE_ALLOW_INVALID),
opfam.data,
format_procedure(amprocForm->amproc));