From f81d94c0cc8aaa54b186adeddb1e23448ea76220 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 25 Feb 2026 08:51:25 +0100 Subject: [PATCH 03/10] Add missing quote_identifier() calls in ruleutils.c --- src/backend/utils/adt/ruleutils.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index b03595a2d50..6193d7715cf 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -1698,7 +1698,7 @@ make_propgraphdef_elements(StringInfo buf, Oid pgrelid, char pgekind) else appendStringInfo(buf, " %s AS %s", generate_relation_name(pgeform->pgerelid, NIL), - NameStr(pgeform->pgealias)); + quote_identifier(NameStr(pgeform->pgealias))); datum = heap_getattr(tup, Anum_pg_propgraph_element_pgekey, RelationGetDescr(pgerel), &isnull); if (!isnull) @@ -1737,12 +1737,12 @@ make_propgraphdef_elements(StringInfo buf, Oid pgrelid, char pgekind) { appendStringInfoString(buf, " KEY ("); decompile_column_index_array(srckey, pgeform->pgerelid, false, buf); - appendStringInfo(buf, ") REFERENCES %s (", NameStr(pgeform2->pgealias)); + appendStringInfo(buf, ") REFERENCES %s (", quote_identifier(NameStr(pgeform2->pgealias))); decompile_column_index_array(srcref, pgeform2->pgerelid, false, buf); appendStringInfoString(buf, ")"); } else - appendStringInfo(buf, " %s ", NameStr(pgeform2->pgealias)); + appendStringInfo(buf, " %s ", quote_identifier(NameStr(pgeform2->pgealias))); ReleaseSysCache(tup2); appendStringInfoString(buf, " DESTINATION"); @@ -1754,12 +1754,12 @@ make_propgraphdef_elements(StringInfo buf, Oid pgrelid, char pgekind) { appendStringInfoString(buf, " KEY ("); decompile_column_index_array(destkey, pgeform->pgerelid, false, buf); - appendStringInfo(buf, ") REFERENCES %s (", NameStr(pgeform2->pgealias)); + appendStringInfo(buf, ") REFERENCES %s (", quote_identifier(NameStr(pgeform2->pgealias))); decompile_column_index_array(destref, pgeform2->pgerelid, false, buf); appendStringInfoString(buf, ")"); } else - appendStringInfo(buf, " %s", NameStr(pgeform2->pgealias)); + appendStringInfo(buf, " %s", quote_identifier(NameStr(pgeform2->pgealias))); ReleaseSysCache(tup2); } @@ -1915,11 +1915,11 @@ make_propgraphdef_properties(StringInfo buf, Oid ellabelid, Oid elrelid) appendStringInfo(buf, ", "); if (IsA(expr, Var) && strcmp(propname, get_attname(elrelid, castNode(Var, expr)->varattno, false)) == 0) - appendStringInfo(buf, "%s", propname); + appendStringInfo(buf, "%s", quote_identifier(propname)); else appendStringInfo(buf, "%s AS %s", deparse_expression_pretty(expr, context, false, false, 0, 0), - propname); + quote_identifier(propname)); } appendStringInfo(buf, ")"); @@ -8017,7 +8017,7 @@ get_path_pattern_expr_def(List *path_pattern_expr, deparse_context *context) if (gep->variable) { - appendStringInfoString(buf, gep->variable); + appendStringInfoString(buf, quote_identifier(gep->variable)); sep = " "; } -- 2.53.0