v1-0002-psql-Schema-qualify-pg_get_expr-in-publication-de.patch
application/octet-stream
Filename: v1-0002-psql-Schema-qualify-pg_get_expr-in-publication-de.patch
Type: application/octet-stream
Part: 1
Patch
Format: format-patch
Series: patch v1-0002
Subject: psql: Schema-qualify pg_get_expr() in publication describe queries
| File | + | − |
|---|---|---|
| src/bin/psql/describe.c | 2 | 2 |
From bb58dcb7ce8386dcff84efde6a7feab7bac0eaa8 Mon Sep 17 00:00:00 2001
From: "Chao Li (Evan)" <lic@highgo.com>
Date: Mon, 8 Jun 2026 16:11:51 +0800
Subject: [PATCH v1 2/2] psql: Schema-qualify pg_get_expr() in publication
describe queries
The publication describe queries used unqualified pg_get_expr() calls when
showing row filters. A user-defined function earlier in search_path could
therefore affect psql describe output.
Use pg_catalog.pg_get_expr(), as nearby describe queries already do.
Author: Chao Li <lic@highgo.com>
---
src/bin/psql/describe.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index a245a0a7912..015586b9895 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -3189,7 +3189,7 @@ describeOneTableDetails(const char *schemaname,
"WHERE pc.oid ='%s' and pg_catalog.pg_relation_is_publishable('%s')\n"
"UNION\n"
"SELECT pubname\n"
- " , pg_get_expr(pr.prqual, c.oid)\n"
+ " , pg_catalog.pg_get_expr(pr.prqual, c.oid)\n"
" , (CASE WHEN pr.prattrs IS NOT NULL THEN\n"
" (SELECT string_agg(attname, ', ')\n"
" FROM pg_catalog.generate_series(0, pg_catalog.array_upper(pr.prattrs::pg_catalog.int2[], 1)) s,\n"
@@ -6995,7 +6995,7 @@ describePublications(const char *pattern)
if (pset.sversion >= 150000)
{
appendPQExpBufferStr(&buf,
- ", pg_get_expr(pr.prqual, c.oid)");
+ ", pg_catalog.pg_get_expr(pr.prqual, c.oid)");
appendPQExpBufferStr(&buf,
", (CASE WHEN pr.prattrs IS NOT NULL THEN\n"
" pg_catalog.array_to_string("
--
2.50.1 (Apple Git-155)