pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio 7+ messages / 1 participants [nested] [flat]
* pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio @ 2026-10-27 21:24 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-27 21:24 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix deparsing of AT TIME ZONE and similar as FROM-clause functions. ruleutils.c's looks_like_function() assumed that all COERCE_SQL_SYNTAX cases produce output that looks like a function call (or at least like one of the syntaxes the func_expr_windowless production accepts). But AT TIME ZONE, AT LOCAL, OVERLAPS and IS xxx NORMALIZED print as other sorts of a_expr, so those cases would produce invalid SQL syntax when used in a FROM clause. Extend the logic to detect which specific functions are safe or unsafe. Author: Henson Choi <assam258@gmail.com> Reviewed-by: Prashant Chinnam <crprashant@hotmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAAAe_zC68s-DwVX1o7C1HVcRk+Z+RTS6Vw19auZFfz=KaX8tZA@mail.gmail.com Backpatch-through: 14 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/03fa13256389e5a5d41c76b14a3c9ffd1e45eb35 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 55 +++++++++++++++++++++++++++++-- src/test/regress/expected/create_view.out | 33 ++++++++++--------- src/test/regress/sql/create_view.sql | 3 +- 3 files changed, 72 insertions(+), 19 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio @ 2026-10-27 21:24 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-27 21:24 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix deparsing of AT TIME ZONE and similar as FROM-clause functions. ruleutils.c's looks_like_function() assumed that all COERCE_SQL_SYNTAX cases produce output that looks like a function call (or at least like one of the syntaxes the func_expr_windowless production accepts). But AT TIME ZONE, AT LOCAL, OVERLAPS and IS xxx NORMALIZED print as other sorts of a_expr, so those cases would produce invalid SQL syntax when used in a FROM clause. Extend the logic to detect which specific functions are safe or unsafe. Author: Henson Choi <assam258@gmail.com> Reviewed-by: Prashant Chinnam <crprashant@hotmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAAAe_zC68s-DwVX1o7C1HVcRk+Z+RTS6Vw19auZFfz=KaX8tZA@mail.gmail.com Backpatch-through: 14 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/baba7bd766b4e9ea676eb551fbd8c437d7a4dc2f Modified Files -------------- src/backend/utils/adt/ruleutils.c | 55 +++++++++++++++++++++++++++++-- src/test/regress/expected/create_view.out | 33 ++++++++++--------- src/test/regress/sql/create_view.sql | 3 +- 3 files changed, 72 insertions(+), 19 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio @ 2026-10-27 21:24 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-27 21:24 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix deparsing of AT TIME ZONE and similar as FROM-clause functions. ruleutils.c's looks_like_function() assumed that all COERCE_SQL_SYNTAX cases produce output that looks like a function call (or at least like one of the syntaxes the func_expr_windowless production accepts). But AT TIME ZONE, AT LOCAL, OVERLAPS and IS xxx NORMALIZED print as other sorts of a_expr, so those cases would produce invalid SQL syntax when used in a FROM clause. Extend the logic to detect which specific functions are safe or unsafe. Author: Henson Choi <assam258@gmail.com> Reviewed-by: Prashant Chinnam <crprashant@hotmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAAAe_zC68s-DwVX1o7C1HVcRk+Z+RTS6Vw19auZFfz=KaX8tZA@mail.gmail.com Backpatch-through: 14 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7933cf45a001322d87e679993c4586ef09bf7e08 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 55 +++++++++++++++++++++++++++++-- src/test/regress/expected/create_view.out | 33 ++++++++++--------- src/test/regress/sql/create_view.sql | 3 +- 3 files changed, 72 insertions(+), 19 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio @ 2026-10-27 21:24 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-27 21:24 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix deparsing of AT TIME ZONE and similar as FROM-clause functions. ruleutils.c's looks_like_function() assumed that all COERCE_SQL_SYNTAX cases produce output that looks like a function call (or at least like one of the syntaxes the func_expr_windowless production accepts). But AT TIME ZONE, AT LOCAL, OVERLAPS and IS xxx NORMALIZED print as other sorts of a_expr, so those cases would produce invalid SQL syntax when used in a FROM clause. Extend the logic to detect which specific functions are safe or unsafe. Author: Henson Choi <assam258@gmail.com> Reviewed-by: Prashant Chinnam <crprashant@hotmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAAAe_zC68s-DwVX1o7C1HVcRk+Z+RTS6Vw19auZFfz=KaX8tZA@mail.gmail.com Backpatch-through: 14 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a5e96ebe7caaa154814e52f771a2466947d17a39 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 51 +++++++++++++++++++++++++++++-- src/test/regress/expected/create_view.out | 33 +++++++++++--------- src/test/regress/sql/create_view.sql | 3 +- 3 files changed, 68 insertions(+), 19 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio @ 2026-10-27 21:24 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-27 21:24 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix deparsing of AT TIME ZONE and similar as FROM-clause functions. ruleutils.c's looks_like_function() assumed that all COERCE_SQL_SYNTAX cases produce output that looks like a function call (or at least like one of the syntaxes the func_expr_windowless production accepts). But AT TIME ZONE, AT LOCAL, OVERLAPS and IS xxx NORMALIZED print as other sorts of a_expr, so those cases would produce invalid SQL syntax when used in a FROM clause. Extend the logic to detect which specific functions are safe or unsafe. Author: Henson Choi <assam258@gmail.com> Reviewed-by: Prashant Chinnam <crprashant@hotmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAAAe_zC68s-DwVX1o7C1HVcRk+Z+RTS6Vw19auZFfz=KaX8tZA@mail.gmail.com Backpatch-through: 14 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/35a8ff7ae64d15dc028c1e33d404738fcaa8d629 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 51 +++++++++++++++++++++++++++++-- src/test/regress/expected/create_view.out | 33 +++++++++++--------- src/test/regress/sql/create_view.sql | 3 +- 3 files changed, 68 insertions(+), 19 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio @ 2026-10-27 21:24 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-27 21:24 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix deparsing of AT TIME ZONE and similar as FROM-clause functions. ruleutils.c's looks_like_function() assumed that all COERCE_SQL_SYNTAX cases produce output that looks like a function call (or at least like one of the syntaxes the func_expr_windowless production accepts). But AT TIME ZONE, AT LOCAL, OVERLAPS and IS xxx NORMALIZED print as other sorts of a_expr, so those cases would produce invalid SQL syntax when used in a FROM clause. Extend the logic to detect which specific functions are safe or unsafe. Author: Henson Choi <assam258@gmail.com> Reviewed-by: Prashant Chinnam <crprashant@hotmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAAAe_zC68s-DwVX1o7C1HVcRk+Z+RTS6Vw19auZFfz=KaX8tZA@mail.gmail.com Backpatch-through: 14 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a44a4f1b6d11e1cb6061e70e112f688bf0a5dc85 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 51 +++++++++++++++++++++++++++++-- src/test/regress/expected/create_view.out | 33 +++++++++++--------- src/test/regress/sql/create_view.sql | 3 +- 3 files changed, 68 insertions(+), 19 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio @ 2026-10-27 21:24 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-10-27 21:24 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix deparsing of AT TIME ZONE and similar as FROM-clause functions. ruleutils.c's looks_like_function() assumed that all COERCE_SQL_SYNTAX cases produce output that looks like a function call (or at least like one of the syntaxes the func_expr_windowless production accepts). But AT TIME ZONE, AT LOCAL, OVERLAPS and IS xxx NORMALIZED print as other sorts of a_expr, so those cases would produce invalid SQL syntax when used in a FROM clause. Extend the logic to detect which specific functions are safe or unsafe. Author: Henson Choi <assam258@gmail.com> Reviewed-by: Prashant Chinnam <crprashant@hotmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAAAe_zC68s-DwVX1o7C1HVcRk+Z+RTS6Vw19auZFfz=KaX8tZA@mail.gmail.com Backpatch-through: 14 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/17a0604c2d626fa4adb2a98f584fc6b7ee72e663 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 55 +++++++++++++++++++++++++++++-- src/test/regress/expected/create_view.out | 33 ++++++++++--------- src/test/regress/sql/create_view.sql | 3 +- 3 files changed, 72 insertions(+), 19 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2026-10-27 21:24 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-10-27 21:24 pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio Tom Lane <tgl@sss.pgh.pa.us> 2026-10-27 21:24 pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio Tom Lane <tgl@sss.pgh.pa.us> 2026-10-27 21:24 pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio Tom Lane <tgl@sss.pgh.pa.us> 2026-10-27 21:24 pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio Tom Lane <tgl@sss.pgh.pa.us> 2026-10-27 21:24 pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio Tom Lane <tgl@sss.pgh.pa.us> 2026-10-27 21:24 pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio Tom Lane <tgl@sss.pgh.pa.us> 2026-10-27 21:24 pgsql: Fix deparsing of AT TIME ZONE and similar as FROM-clause functio 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