pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix inability to reference CYCLE column from inside its CTE. 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix inability to reference CYCLE column from inside its CTE. @ 2022-12-16 18:07 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2022-12-16 18:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix inability to reference CYCLE column from inside its CTE. Such references failed with "cache lookup failed for type 0" because we didn't resolve the type of the CYCLE column until after analyzing the CTE's query. We can just move that processing to before the recursive parse_sub_analyze call, though. While here, invent a couple of local variables to make this code less egregiously wider-than-80-columns. Per bug #17723 from Vik Fearing. Back-patch to v14 where the CYCLE feature was added. Discussion: https://postgr.es/m/17723-2c4985ff111e7bba@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/935277b24172979e8244a5399906c358e4176b49 Modified Files -------------- src/backend/parser/parse_cte.c | 170 +++++++++++++++++++++---------------- src/test/regress/expected/with.out | 23 +++++ src/test/regress/sql/with.sql | 9 ++ 3 files changed, 129 insertions(+), 73 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix inability to reference CYCLE column from inside its CTE. @ 2022-12-16 18:07 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2022-12-16 18:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix inability to reference CYCLE column from inside its CTE. Such references failed with "cache lookup failed for type 0" because we didn't resolve the type of the CYCLE column until after analyzing the CTE's query. We can just move that processing to before the recursive parse_sub_analyze call, though. While here, invent a couple of local variables to make this code less egregiously wider-than-80-columns. Per bug #17723 from Vik Fearing. Back-patch to v14 where the CYCLE feature was added. Discussion: https://postgr.es/m/17723-2c4985ff111e7bba@postgresql.org Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ea5ae4cae6a230e048f0ff4587b54d441712c6fd Modified Files -------------- src/backend/parser/parse_cte.c | 170 +++++++++++++++++++++---------------- src/test/regress/expected/with.out | 23 +++++ src/test/regress/sql/with.sql | 9 ++ 3 files changed, 129 insertions(+), 73 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix inability to reference CYCLE column from inside its CTE. @ 2022-12-16 18:07 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2022-12-16 18:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix inability to reference CYCLE column from inside its CTE. Such references failed with "cache lookup failed for type 0" because we didn't resolve the type of the CYCLE column until after analyzing the CTE's query. We can just move that processing to before the recursive parse_sub_analyze call, though. While here, invent a couple of local variables to make this code less egregiously wider-than-80-columns. Per bug #17723 from Vik Fearing. Back-patch to v14 where the CYCLE feature was added. Discussion: https://postgr.es/m/17723-2c4985ff111e7bba@postgresql.org Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ae98debf77d4aba7caa305fa4957577528699470 Modified Files -------------- src/backend/parser/parse_cte.c | 170 +++++++++++++++++++++---------------- src/test/regress/expected/with.out | 23 +++++ src/test/regress/sql/with.sql | 9 ++ 3 files changed, 129 insertions(+), 73 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2022-12-16 18:07 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-12-16 18:07 pgsql: Fix inability to reference CYCLE column from inside its CTE. Tom Lane <tgl@sss.pgh.pa.us> 2022-12-16 18:07 pgsql: Fix inability to reference CYCLE column from inside its CTE. Tom Lane <tgl@sss.pgh.pa.us> 2022-12-16 18:07 pgsql: Fix inability to reference CYCLE column from inside its CTE. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox