8000 Fix some string building in getObjectDescription. · postgrespro/postgres_cluster@f23b791 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f23b791

Browse files
committed
Fix some string building in getObjectDescription.
1 parent c8e0d68 commit f23b791

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

src/backend/catalog/dependency.c

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.72 2008/05/12 00:00:46 alvherre Exp $
11+
* $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.73 2008/06/05 15:04:39 alvherre Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2005,6 +2005,7 @@ getObjectDescription(const ObjectAddress *object)
20052005
SysScanDesc amscan;
20062006
HeapTuple tup;
20072007
Form_pg_amop amopForm;
2008+
StringInfoData opfam;
20082009

20092010
amopDesc = heap_open(AccessMethodOperatorRelationId,
20102011
AccessShareLock);
@@ -2025,10 +2026,18 @@ getObjectDescription(const ObjectAddress *object)
20252026

20262027
amopForm = (Form_pg_amop) GETSTRUCT(tup);
20272028

2028-
appendStringInfo(&buffer, _("operator %d %s of "),
2029+
initStringInfo(&opfam);
2030+
getOpFamilyDescription(&opfam, amopForm->amopfamily);
2031+
/*
2032+
* translator: %d is the operator strategy (a number), the
2033+
* first %s is the textual form of the operator, and the second
2034+
* %s is the description of the operator family.
2035+
*/
2036+
appendStringInfo(&buffer, _("operator %d %s of %s"),
20292037
amopForm->amopstrategy,
2030-
format_operator(amopForm->amopopr));
2031-
getOpFamilyDescription(&buffer, amopForm->amopfamily);
2038+
format_operator(amopForm->amopopr),
2039+
opfam.data);
2040+
pfree(opfam.data);
20322041

20332042
systable_endscan(amscan);
20342043
heap_close(amopDesc, AccessShareLock);
@@ -2042,6 +2051,7 @@ getObjectDescription(const ObjectAddress *object)
20422051
SysScanDesc amscan;
20432052
HeapTuple tup;
20442053
Form_pg_amproc amprocForm;
2054+
StringInfoData opfam;
20452055

20462056
amprocDesc = heap_open(AccessMethodProcedureRelationId,
20472057
AccessShareLock);
@@ -2062,10 +2072,18 @@ getObjectDescription(const ObjectAddress *object)
20622072

20632073
amprocForm = (Form_pg_amproc) GETSTRUCT(tup);
20642074

2065-
appendStringInfo(&buffer, _("function %d %s of "),
2075+
initStringInfo(&opfam);
2076+
getOpFamilyDescription(&opfam, amprocForm->amprocfamily);
2077+
/*
2078+
* translator: %d is the function number, the first %s is the
2079+
* textual form of the function with arguments, and the second
2080+
* %s is the description of the operator family.
2081+
*/
2082+
appendStringInfo(&buffer, _("function %d %s of %s"),
20662083
amprocForm->amprocnum,
2067-
format_procedure(amprocForm->amproc));
2068-
getOpFamilyDescription(&buffer, amprocForm->amprocfamily);
2084+
format_procedure(amprocForm->amproc),
2085+
opfam.data);
2086+
pfree(opfam.data);
20692087

20702088
systable_endscan(amscan);
20712089
heap_close(amprocDesc, AccessShareLock);

0 commit comments

Comments
 (0)
0