Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit dd5f0db

Browse files
committed
Improve getObjectDescription's display of pg_amop and pg_amproc entries.
Include the lefttype/righttype columns explicitly (instead of assuming the reader can deduce them from the operator or function description), and move the operator or function description to the end of the string, to make it clearer that it's a referenced object and not the amop or amproc item itself. Per extensive discussion of Andreas Karlsson's original patch. Andreas Karlsson, Tom Lane
1 parent de3c2d6 commit dd5f0db

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

src/backend/catalog/dependency.c

+19-11
Original file line numberDiff line numberDiff line change
@@ -2339,13 +2339,17 @@ getObjectDescription(const ObjectAddress *object)
23392339

23402340
/*
23412341
* translator: %d is the operator strategy (a number), the
2342-
* first %s is the textual form of the operator, and the
2343-
* second %s is the description of the operator family.
2342+
* first two %s's are data type names, the third %s is the
2343+
* description of the operator family, and the last %s is the
2344+
* textual form of the operator with arguments.
23442345
*/
2345-
appendStringInfo(&buffer, _("operator %d %s of %s"),
2346+
appendStringInfo(&buffer, _("operator %d (%s, %s) of %s: %s"),
23462347
amopForm->amopstrategy,
2347-
format_operator(amopForm->amopopr),
2348-
opfam.data);
2348+
format_type_be(amopForm->amoplefttype),
2349+
format_type_be(amopForm->amoprighttype),
2350+
opfam.data,
2351+
format_operator(amopForm->amopopr));
2352+
23492353
pfree(opfam.data);
23502354

23512355
systable_endscan(amscan);
@@ -2385,14 +2389,18 @@ getObjectDescription(const ObjectAddress *object)
23852389
getOpFamilyDescription(&opfam, amprocForm->amprocfamily);
23862390

23872391
/*
2388-
* translator: %d is the function number, the first %s is the
2389-
* textual form of the function with arguments, and the second
2390-
* %s is the description of the operator family.
2392+
* translator: %d is the function number, the first two %s's
2393+
* are data type names, the third %s is the description of the
2394+
* operator family, and the last %s is the textual form of the
2395+
* function with arguments.
23912396
*/
2392-
appendStringInfo(&buffer, _("function %d %s of %s"),
2397+
appendStringInfo(&buffer, _("function %d (%s, %s) of %s: %s"),
23932398
amprocForm->amprocnum,
2394-
format_procedure(amprocForm->amproc),
2395-
opfam.data);
2399+
format_type_be(amprocForm->amproclefttype),
2400+
format_type_be(amprocForm->amprocrighttype),
2401+
opfam.data,
2402+
format_procedure(amprocForm->amproc));
2403+
23962404
pfree(opfam.data);
23972405

23982406
systable_endscan(amscan);

0 commit comments

Comments
 (0)