public inbox for [email protected]
help / color / mirror / Atom feedBug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references
4+ messages / 3 participants
[nested] [flat]
* Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references
@ 2026-04-18 07:56 SATYANARAYANA NARLAPURAM <[email protected]>
2026-04-21 06:51 ` Re: Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references Ashutosh Bapat <[email protected]>
0 siblings, 1 reply; 4+ messages in thread
From: SATYANARAYANA NARLAPURAM @ 2026-04-18 07:56 UTC (permalink / raw)
To: PostgreSQL Hackers <[email protected]>; Ashutosh Bapat <[email protected]>
Hi hackers,
pg_get_viewdef() fails with ERROR: bogus varlevelsup: 0 offset 0 for any
view containing a GRAPH_TABLE whose COLUMNS clause references an outer
(lateral)
table. This also breaks pg_dump and \d+ for any database containing such a
view.
Repro:
CREATE TABLE vtab (id int PRIMARY KEY, name text);
CREATE TABLE etab (eid int PRIMARY KEY,
src int REFERENCES vtab(id), dst int REFERENCES vtab(id));
CREATE PROPERTY GRAPH g1
VERTEX TABLES (vtab)
EDGE TABLES (etab KEY (eid)
SOURCE KEY (src) REFERENCES vtab(id)
DESTINATION KEY (dst) REFERENCES vtab(id));
CREATE TABLE outer_t (val int);
CREATE VIEW v AS
SELECT * FROM outer_t,
GRAPH_TABLE (g1 MATCH (a IS vtab)
COLUMNS (a.name AS src_name, outer_t.val AS oval));
pg_dump -d foo -p 5433
pg_dump: error: query failed: ERROR: bogus varlevelsup: 0 offset 0
pg_dump: detail: Query was: SELECT
pg_catalog.pg_get_viewdef('173849'::pg_catalog.oid) AS viewdef
Problem:
deparse_context context variable declared in the case RTE_GRAPH_TABLE
shadows the function's
deparse_context *context parameter. The zeroed struct has namespaces = NIL,
so when get_rule_expr()
reaches a Var node, get_variable() sees list_length(context->namespaces) ==
0 and raises the error. Property
references are fine because GraphPropertyRef deparsing never touches
namespaces.
Fix:
Remove the shadowing local variable and pass the outer context pointer to
get_rule_expr(). Attached a patch
with a fix, additionally added a test.
Thanks,
Satya
Attachments:
[application/octet-stream] 0001-Fix-pg_get_viewdef-crash-for-GRAPH_TABLE-views-with-.patch (4.9K, 3-0001-Fix-pg_get_viewdef-crash-for-GRAPH_TABLE-views-with-.patch)
download | inline diff:
From f9667899154e6a42e6e73d9f21393384a9ff1dc2 Mon Sep 17 00:00:00 2001
From: Ubuntu
<azureuser@pgclient.5sdvw5dac2hu3o3frfdg3sxydd.zx.internal.cloudapp.net>
Date: Sat, 18 Apr 2026 07:34:58 +0000
Subject: [PATCH] Fix pg_get_viewdef() crash for GRAPH_TABLE views with lateral
column refs
get_from_clause_item() in ruleutils.c declares a local 'deparse_context
context = {0}' inside the RTE_GRAPH_TABLE COLUMNS loop, which shadows the
function's 'deparse_context *context' parameter. The zeroed struct has
namespaces = NIL, so when get_rule_expr() encounters a Var node (from a
lateral column reference in COLUMNS), get_variable() finds list_length(0)
and errors with 'bogus varlevelsup: 0 offset 0'.
Fix by removing the shadowing local variable and passing the outer context
pointer through to get_rule_expr(), which is what every other RTE case in
this function already does.
This crash affects pg_get_viewdef(), pg_dump, and psql's \d+ for any view
containing a GRAPH_TABLE with lateral column references in its COLUMNS
clause.
---
src/backend/utils/adt/ruleutils.c | 5 +----
src/test/regress/expected/graph_table.out | 19 +++++++++++++++++++
src/test/regress/sql/graph_table.sql | 11 +++++++++++
3 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 090e8cc2..148eb5bb 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -13097,16 +13097,13 @@ get_from_clause_item(Node *jtnode, Query *query, deparse_context *context)
foreach(lc, rte->graph_table_columns)
{
TargetEntry *te = lfirst_node(TargetEntry, lc);
- deparse_context context = {0};
if (!first)
appendStringInfoString(buf, ", ");
else
first = false;
- context.buf = buf;
-
- get_rule_expr((Node *) te->expr, &context, false);
+ get_rule_expr((Node *) te->expr, context, false);
appendStringInfoString(buf, " AS ");
appendStringInfoString(buf, quote_identifier(te->resname));
}
diff --git a/src/test/regress/expected/graph_table.out b/src/test/regress/expected/graph_table.out
index b579e3df..d7b767be 100644
--- a/src/test/regress/expected/graph_table.out
+++ b/src/test/regress/expected/graph_table.out
@@ -932,6 +932,25 @@ SELECT pg_get_viewdef('customers_us'::regclass);
ORDER BY customer_name, product_name;
(1 row)
+-- ruleutils reverse parsing with lateral column reference in COLUMNS
+CREATE TABLE lateral_t (val int);
+INSERT INTO lateral_t VALUES (1);
+CREATE VIEW gt_lateral_view AS
+ SELECT * FROM lateral_t,
+ GRAPH_TABLE (myshop MATCH (c IS customers)
+ COLUMNS (c.name AS cname, lateral_t.val AS lval));
+SELECT pg_get_viewdef('gt_lateral_view'::regclass);
+ pg_get_viewdef
+---------------------------------------------------------------------------------------------------
+ SELECT lateral_t.val, +
+ "graph_table".cname, +
+ "graph_table".lval +
+ FROM lateral_t, +
+ GRAPH_TABLE (myshop MATCH (c IS customers) COLUMNS (c.name AS cname, lateral_t.val AS lval));
+(1 row)
+
+DROP VIEW gt_lateral_view;
+DROP TABLE lateral_t;
-- test view/graph nesting
CREATE VIEW customers_view AS SELECT customer_id, 'redacted' || customer_id AS name_redacted, address FROM customers;
SELECT * FROM customers;
diff --git a/src/test/regress/sql/graph_table.sql b/src/test/regress/sql/graph_table.sql
index 4ff98817..90e5ea2e 100644
--- a/src/test/regress/sql/graph_table.sql
+++ b/src/test/regress/sql/graph_table.sql
@@ -528,6 +528,17 @@ SELECT * FROM GRAPH_TABLE (g4 MATCH (s WHERE s.id = 3)-[e]-(d) COLUMNS (s.val, e
CREATE VIEW customers_us AS SELECT * FROM GRAPH_TABLE (myshop MATCH (c IS customers WHERE c.address = 'US')-[IS customer_orders | customer_wishlists ]->(l IS orders | wishlists)-[ IS list_items]->(p IS products) COLUMNS (c.name AS customer_name, p.name AS product_name)) ORDER BY customer_name, product_name;
SELECT pg_get_viewdef('customers_us'::regclass);
+-- ruleutils reverse parsing with lateral column reference in COLUMNS
+CREATE TABLE lateral_t (val int);
+INSERT INTO lateral_t VALUES (1);
+CREATE VIEW gt_lateral_view AS
+ SELECT * FROM lateral_t,
+ GRAPH_TABLE (myshop MATCH (c IS customers)
+ COLUMNS (c.name AS cname, lateral_t.val AS lval));
+SELECT pg_get_viewdef('gt_lateral_view'::regclass);
+DROP VIEW gt_lateral_view;
+DROP TABLE lateral_t;
+
-- test view/graph nesting
CREATE VIEW customers_view AS SELECT customer_id, 'redacted' || customer_id AS name_redacted, address FROM customers;
--
2.43.0
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references
2026-04-18 07:56 Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references SATYANARAYANA NARLAPURAM <[email protected]>
@ 2026-04-21 06:51 ` Ashutosh Bapat <[email protected]>
2026-04-21 08:02 ` Re: Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references SATYANARAYANA NARLAPURAM <[email protected]>
0 siblings, 1 reply; 4+ messages in thread
From: Ashutosh Bapat @ 2026-04-21 06:51 UTC (permalink / raw)
To: SATYANARAYANA NARLAPURAM <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]>
On Sat, Apr 18, 2026 at 1:26 PM SATYANARAYANA NARLAPURAM
<[email protected]> wrote:
>
> Hi hackers,
>
> pg_get_viewdef() fails with ERROR: bogus varlevelsup: 0 offset 0 for any
> view containing a GRAPH_TABLE whose COLUMNS clause references an outer (lateral)
> table. This also breaks pg_dump and \d+ for any database containing such a
> view.
>
> Repro:
>
> CREATE TABLE vtab (id int PRIMARY KEY, name text);
> CREATE TABLE etab (eid int PRIMARY KEY,
> src int REFERENCES vtab(id), dst int REFERENCES vtab(id));
> CREATE PROPERTY GRAPH g1
> VERTEX TABLES (vtab)
> EDGE TABLES (etab KEY (eid)
> SOURCE KEY (src) REFERENCES vtab(id)
> DESTINATION KEY (dst) REFERENCES vtab(id));
> CREATE TABLE outer_t (val int);
>
> CREATE VIEW v AS
> SELECT * FROM outer_t,
> GRAPH_TABLE (g1 MATCH (a IS vtab)
> COLUMNS (a.name AS src_name, outer_t.val AS oval));
>
> pg_dump -d foo -p 5433
> pg_dump: error: query failed: ERROR: bogus varlevelsup: 0 offset 0
> pg_dump: detail: Query was: SELECT pg_catalog.pg_get_viewdef('173849'::pg_catalog.oid) AS viewdef
>
> Problem:
> deparse_context context variable declared in the case RTE_GRAPH_TABLE shadows the function's
> deparse_context *context parameter. The zeroed struct has namespaces = NIL, so when get_rule_expr()
> reaches a Var node, get_variable() sees list_length(context->namespaces) == 0 and raises the error. Property
> references are fine because GraphPropertyRef deparsing never touches namespaces.
>
> Fix:
> Remove the shadowing local variable and pass the outer context pointer to get_rule_expr(). Attached a patch
> with a fix, additionally added a test.
The code doesn't explain why it adds the dummy context but it seemed
intentional. But it's not used at other places like deparsing WHERE
clause in element patterns or that in the graph_table itself. Since a
lateral reference is allowed in COLUMNS clause as well, it doesn't
make sense not to pass a context with lateral namespaces. Also there
is no comment explaining the dummy context. So your fix looks good to
me. I adjusted the surrounding code a bit.
I adjusted an existing view for the testing instead of adding a new
one with all the additional objects. Since that view definition was
getting more complex, I formatted the DDL to be more readable.
I also think that we should use prettyFlags to deparse all GRAPH_TABLE
components in a human readable form. But that's out of the scope for
this patch.
PFA updated patch.
--
Best Wishes,
Ashutosh Bapat
Attachments:
[text/x-patch] v20260421-0001-pg_get_viewdef-and-lateral-references-in-C.patch (9.3K, 2-v20260421-0001-pg_get_viewdef-and-lateral-references-in-C.patch)
download | inline diff:
From 6b54b4409df4ce1e8ba50c615e10e5cce3cea075 Mon Sep 17 00:00:00 2001
From: Ashutosh Bapat <[email protected]>
Date: Tue, 21 Apr 2026 11:43:43 +0530
Subject: [PATCH v20260421 4/4] pg_get_viewdef() and lateral references in
COLUMNS of GRAPH_TABLE
Expressions in GRAPH_TABLE COLUMNS list may have lateral references.
get_rule_expr() requires lateral namespaces to deparse such references.
get_from_clause_item() does not pass them when processing the
expressions in COLUMNS list causing ERROR "bogus varlevelsup: 0 offset
0". Fix get_from_clause_item() to pass input deparse_context containing
lateral namespaces to get_rule_expr() instead of the dummy context.
Reported By: SATYANARAYANA NARLAPURAM <[email protected]>
Author: SATYANARAYANA NARLAPURAM <[email protected]>
Reviewed By: Ashutosh Bapat <[email protected]>
---
src/backend/utils/adt/ruleutils.c | 10 ++-------
src/test/regress/expected/graph_table.out | 26 ++++++++++++++++-------
src/test/regress/sql/graph_table.sql | 12 +++++++++--
3 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 78587d223cb..c781cdc84d3 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -13091,22 +13091,16 @@ get_from_clause_item(Node *jtnode, Query *query, deparse_context *context)
get_graph_pattern_def(rte->graph_pattern, context);
appendStringInfoString(buf, " COLUMNS (");
{
- ListCell *lc;
bool first = true;
- foreach(lc, rte->graph_table_columns)
+ foreach_node(TargetEntry, te, rte->graph_table_columns)
{
- TargetEntry *te = lfirst_node(TargetEntry, lc);
- deparse_context context = {0};
-
if (!first)
appendStringInfoString(buf, ", ");
else
first = false;
- context.buf = buf;
-
- get_rule_expr((Node *) te->expr, &context, false);
+ get_rule_expr((Node *) te->expr, context, false);
appendStringInfoString(buf, " AS ");
appendStringInfoString(buf, quote_identifier(te->resname));
}
diff --git a/src/test/regress/expected/graph_table.out b/src/test/regress/expected/graph_table.out
index 057f283c43d..12b8706b5f3 100644
--- a/src/test/regress/expected/graph_table.out
+++ b/src/test/regress/expected/graph_table.out
@@ -264,7 +264,6 @@ SELECT x1.a, g.* FROM x1, GRAPH_TABLE (myshop MATCH (c IS customers WHERE c.addr
ERROR: non-local element variable reference is not supported
LINE 1: ...tomers WHERE c.address = 'US' AND c.customer_id = x1.a)-[IS ...
^
-DROP TABLE x1;
CREATE TABLE v1 (
id int PRIMARY KEY,
vname varchar(10),
@@ -922,14 +921,25 @@ SELECT * FROM GRAPH_TABLE (g4 MATCH (s WHERE s.id = 3)-[e]-(d) COLUMNS (s.val, e
(2 rows)
-- ruleutils reverse parsing
-CREATE VIEW customers_us AS SELECT * FROM GRAPH_TABLE (myshop MATCH (c IS customers WHERE c.address = 'US')-[IS customer_orders | customer_wishlists ]->(l IS orders | wishlists)-[ IS list_items]->(p IS products) COLUMNS (c.name AS customer_name, p.name AS product_name)) ORDER BY customer_name, product_name;
+-- The query in the view definition is intentionally complex to test one view with many
+-- features like label disjunction, lateral references, WHERE clauses in graph
+-- patterns.
+CREATE VIEW customers_us AS
+SELECT g.* FROM x1,
+ GRAPH_TABLE (myshop MATCH (c IS customers WHERE c.address = 'US' AND c.customer_id = x1.a)
+ -[IS customer_orders | customer_wishlists ]->
+ (l IS orders | wishlists)-[ IS list_items]->(p IS products)
+ COLUMNS (c.name AS customer_name, p.name AS product_name, x1.a AS a)) g
+ ORDER BY customer_name, product_name;
SELECT pg_get_viewdef('customers_us'::regclass);
- pg_get_viewdef
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- SELECT customer_name, +
- product_name +
- FROM GRAPH_TABLE (myshop MATCH (c IS customers WHERE ((c.address)::text = 'US'::text))-[IS customer_orders|customer_wishlists]->(l IS orders|wishlists)-[IS list_items]->(p IS products) COLUMNS (c.name AS customer_name, p.name AS product_name))+
- ORDER BY customer_name, product_name;
+ pg_get_viewdef
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ SELECT g.customer_name, +
+ g.product_name, +
+ g.a +
+ FROM x1, +
+ GRAPH_TABLE (myshop MATCH (c IS customers WHERE (((c.address)::text = 'US'::text) AND (c.customer_id = x1.a)))-[IS customer_orders|customer_wishlists]->(l IS orders|wishlists)-[IS list_items]->(p IS products) COLUMNS (c.name AS customer_name, p.name AS product_name, x1.a AS a)) g+
+ ORDER BY g.customer_name, g.product_name;
(1 row)
-- test view/graph nesting
diff --git a/src/test/regress/sql/graph_table.sql b/src/test/regress/sql/graph_table.sql
index 278064818ff..a5df4647b6a 100644
--- a/src/test/regress/sql/graph_table.sql
+++ b/src/test/regress/sql/graph_table.sql
@@ -162,7 +162,6 @@ SELECT x1.a, g.* FROM x1, GRAPH_TABLE (myshop MATCH (x1 IS customers WHERE x1.ad
-- reference is available
SELECT x1.a, g.* FROM x1, GRAPH_TABLE (myshop MATCH (x1 IS customers)-[IS customer_orders]->(o IS orders WHERE o.order_id = x1.a) COLUMNS (x1.name AS customer_name, x1.customer_id AS cid, o.order_id)) g; -- error
SELECT x1.a, g.* FROM x1, GRAPH_TABLE (myshop MATCH (c IS customers WHERE c.address = 'US' AND c.customer_id = x1.a)-[IS customer_orders]->(x1 IS orders) COLUMNS (c.name AS customer_name, c.customer_id AS cid, x1.order_id)) g; -- error
-DROP TABLE x1;
CREATE TABLE v1 (
id int PRIMARY KEY,
@@ -525,7 +524,16 @@ SELECT * FROM GRAPH_TABLE (g4 MATCH (s)-[e]-(d) WHERE s.id = 3 COLUMNS (s.val, e
SELECT * FROM GRAPH_TABLE (g4 MATCH (s WHERE s.id = 3)-[e]-(d) COLUMNS (s.val, e.val, d.val)) ORDER BY 1, 2, 3;
-- ruleutils reverse parsing
-CREATE VIEW customers_us AS SELECT * FROM GRAPH_TABLE (myshop MATCH (c IS customers WHERE c.address = 'US')-[IS customer_orders | customer_wishlists ]->(l IS orders | wishlists)-[ IS list_items]->(p IS products) COLUMNS (c.name AS customer_name, p.name AS product_name)) ORDER BY customer_name, product_name;
+-- The query in the view definition is intentionally complex to test one view with many
+-- features like label disjunction, lateral references, WHERE clauses in graph
+-- patterns.
+CREATE VIEW customers_us AS
+SELECT g.* FROM x1,
+ GRAPH_TABLE (myshop MATCH (c IS customers WHERE c.address = 'US' AND c.customer_id = x1.a)
+ -[IS customer_orders | customer_wishlists ]->
+ (l IS orders | wishlists)-[ IS list_items]->(p IS products)
+ COLUMNS (c.name AS customer_name, p.name AS product_name, x1.a AS a)) g
+ ORDER BY customer_name, product_name;
SELECT pg_get_viewdef('customers_us'::regclass);
-- test view/graph nesting
--
2.34.1
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references
2026-04-18 07:56 Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references SATYANARAYANA NARLAPURAM <[email protected]>
2026-04-21 06:51 ` Re: Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references Ashutosh Bapat <[email protected]>
@ 2026-04-21 08:02 ` SATYANARAYANA NARLAPURAM <[email protected]>
2026-04-24 07:18 ` Re: Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references Peter Eisentraut <[email protected]>
0 siblings, 1 reply; 4+ messages in thread
From: SATYANARAYANA NARLAPURAM @ 2026-04-21 08:02 UTC (permalink / raw)
To: Ashutosh Bapat <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]>
Hi Ashutosh,
On Mon, Apr 20, 2026 at 11:52 PM Ashutosh Bapat <
[email protected]> wrote:
> On Sat, Apr 18, 2026 at 1:26 PM SATYANARAYANA NARLAPURAM
> <[email protected]> wrote:
> >
> > Hi hackers,
> >
> > pg_get_viewdef() fails with ERROR: bogus varlevelsup: 0 offset 0 for any
> > view containing a GRAPH_TABLE whose COLUMNS clause references an outer
> (lateral)
> > table. This also breaks pg_dump and \d+ for any database containing such
> a
> > view.
> >
> > Repro:
> >
> > CREATE TABLE vtab (id int PRIMARY KEY, name text);
> > CREATE TABLE etab (eid int PRIMARY KEY,
> > src int REFERENCES vtab(id), dst int REFERENCES vtab(id));
> > CREATE PROPERTY GRAPH g1
> > VERTEX TABLES (vtab)
> > EDGE TABLES (etab KEY (eid)
> > SOURCE KEY (src) REFERENCES vtab(id)
> > DESTINATION KEY (dst) REFERENCES vtab(id));
> > CREATE TABLE outer_t (val int);
> >
> > CREATE VIEW v AS
> > SELECT * FROM outer_t,
> > GRAPH_TABLE (g1 MATCH (a IS vtab)
> > COLUMNS (a.name AS src_name, outer_t.val AS oval));
> >
> > pg_dump -d foo -p 5433
> > pg_dump: error: query failed: ERROR: bogus varlevelsup: 0 offset 0
> > pg_dump: detail: Query was: SELECT
> pg_catalog.pg_get_viewdef('173849'::pg_catalog.oid) AS viewdef
> >
> > Problem:
> > deparse_context context variable declared in the case RTE_GRAPH_TABLE
> shadows the function's
> > deparse_context *context parameter. The zeroed struct has namespaces =
> NIL, so when get_rule_expr()
> > reaches a Var node, get_variable() sees list_length(context->namespaces)
> == 0 and raises the error. Property
> > references are fine because GraphPropertyRef deparsing never touches
> namespaces.
> >
> > Fix:
> > Remove the shadowing local variable and pass the outer context pointer
> to get_rule_expr(). Attached a patch
> > with a fix, additionally added a test.
>
> The code doesn't explain why it adds the dummy context but it seemed
> intentional. But it's not used at other places like deparsing WHERE
> clause in element patterns or that in the graph_table itself. Since a
> lateral reference is allowed in COLUMNS clause as well, it doesn't
> make sense not to pass a context with lateral namespaces. Also there
> is no comment explaining the dummy context. So your fix looks good to
> me. I adjusted the surrounding code a bit.
>
> I adjusted an existing view for the testing instead of adding a new
> one with all the additional objects. Since that view definition was
> getting more complex, I formatted the DDL to be more readable.
>
> I also think that we should use prettyFlags to deparse all GRAPH_TABLE
> components in a human readable form. But that's out of the scope for
> this patch.
>
> PFA updated patch.
>
Thank you for updating the patch. It applies cleanly and the related tests
are passing.
Thanks,
Satya
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references
2026-04-18 07:56 Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references SATYANARAYANA NARLAPURAM <[email protected]>
2026-04-21 06:51 ` Re: Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references Ashutosh Bapat <[email protected]>
2026-04-21 08:02 ` Re: Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references SATYANARAYANA NARLAPURAM <[email protected]>
@ 2026-04-24 07:18 ` Peter Eisentraut <[email protected]>
0 siblings, 0 replies; 4+ messages in thread
From: Peter Eisentraut @ 2026-04-24 07:18 UTC (permalink / raw)
To: SATYANARAYANA NARLAPURAM <[email protected]>; Ashutosh Bapat <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]>
On 21.04.26 10:02, SATYANARAYANA NARLAPURAM wrote:
> The code doesn't explain why it adds the dummy context but it seemed
> intentional. But it's not used at other places like deparsing WHERE
> clause in element patterns or that in the graph_table itself. Since a
> lateral reference is allowed in COLUMNS clause as well, it doesn't
> make sense not to pass a context with lateral namespaces. Also there
> is no comment explaining the dummy context. So your fix looks good to
> me. I adjusted the surrounding code a bit.
>
> I adjusted an existing view for the testing instead of adding a new
> one with all the additional objects. Since that view definition was
> getting more complex, I formatted the DDL to be more readable.
>
> I also think that we should use prettyFlags to deparse all GRAPH_TABLE
> components in a human readable form. But that's out of the scope for
> this patch.
>
> PFA updated patch.
>
> Thank you for updating the patch. It applies cleanly and the related
> tests are passing.
committed
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2026-04-24 07:18 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-18 07:56 Bug: pg_get_viewdef() fails on GRAPH_TABLE views with lateral column references SATYANARAYANA NARLAPURAM <[email protected]>
2026-04-21 06:51 ` Ashutosh Bapat <[email protected]>
2026-04-21 08:02 ` SATYANARAYANA NARLAPURAM <[email protected]>
2026-04-24 07:18 ` Peter Eisentraut <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox