pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( 12+ messages / 1 participants [nested] [flat]
* pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( @ 2015-11-15 19:41 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 12+ messages in thread From: Tom Lane @ 2015-11-15 19:41 UTC (permalink / raw) To: pgsql-committers Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES() contexts. Normally ruleutils prints a whole-row Var as "foo.*". We already knew that that doesn't work at top level of a SELECT list, because the parser would treat the "*" as a directive to expand the reference into separate columns, not a whole-row Var. However, Joshua Yanovski points out in bug #13776 that the same thing happens at top level of a ROW() construct; and some nosing around in the parser shows that the same is true in VALUES(). Hence, apply the same workaround already devised for the SELECT-list case, namely to add a forced cast to the appropriate rowtype in these cases. (The alternative of just printing "foo" was rejected because it is difficult to avoid ambiguity against plain columns named "foo".) Back-patch to all supported branches. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/7745bc352a82bd588be986479c7aabc3b076a375 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 35 +++++++++-- src/test/regress/expected/create_view.out | 91 +++++++++++++++++++++++++++++ src/test/regress/sql/create_view.sql | 18 ++++++ 3 files changed, 139 insertions(+), 5 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 12+ messages in thread
* pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( @ 2015-11-15 19:41 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 12+ messages in thread From: Tom Lane @ 2015-11-15 19:41 UTC (permalink / raw) To: pgsql-committers Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES() contexts. Normally ruleutils prints a whole-row Var as "foo.*". We already knew that that doesn't work at top level of a SELECT list, because the parser would treat the "*" as a directive to expand the reference into separate columns, not a whole-row Var. However, Joshua Yanovski points out in bug #13776 that the same thing happens at top level of a ROW() construct; and some nosing around in the parser shows that the same is true in VALUES(). Hence, apply the same workaround already devised for the SELECT-list case, namely to add a forced cast to the appropriate rowtype in these cases. (The alternative of just printing "foo" was rejected because it is difficult to avoid ambiguity against plain columns named "foo".) Back-patch to all supported branches. Branch ------ REL9_5_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/0489a048d3914e4d5f89c91ac604350b9392e6fa Modified Files -------------- src/backend/utils/adt/ruleutils.c | 35 +++++++++-- src/test/regress/expected/create_view.out | 91 +++++++++++++++++++++++++++++ src/test/regress/sql/create_view.sql | 18 ++++++ 3 files changed, 139 insertions(+), 5 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 12+ messages in thread
* pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( @ 2015-11-15 19:41 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 12+ messages in thread From: Tom Lane @ 2015-11-15 19:41 UTC (permalink / raw) To: pgsql-committers Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES() contexts. Normally ruleutils prints a whole-row Var as "foo.*". We already knew that that doesn't work at top level of a SELECT list, because the parser would treat the "*" as a directive to expand the reference into separate columns, not a whole-row Var. However, Joshua Yanovski points out in bug #13776 that the same thing happens at top level of a ROW() construct; and some nosing around in the parser shows that the same is true in VALUES(). Hence, apply the same workaround already devised for the SELECT-list case, namely to add a forced cast to the appropriate rowtype in these cases. (The alternative of just printing "foo" was rejected because it is difficult to avoid ambiguity against plain columns named "foo".) Back-patch to all supported branches. Branch ------ REL9_4_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/d33ab56b0ee3dbb5a353bf07804820f1daa199d5 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 35 +++++++++-- src/test/regress/expected/create_view.out | 91 +++++++++++++++++++++++++++++ src/test/regress/sql/create_view.sql | 18 ++++++ 3 files changed, 139 insertions(+), 5 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 12+ messages in thread
* pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( @ 2015-11-15 19:41 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 12+ messages in thread From: Tom Lane @ 2015-11-15 19:41 UTC (permalink / raw) To: pgsql-committers Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES() contexts. Normally ruleutils prints a whole-row Var as "foo.*". We already knew that that doesn't work at top level of a SELECT list, because the parser would treat the "*" as a directive to expand the reference into separate columns, not a whole-row Var. However, Joshua Yanovski points out in bug #13776 that the same thing happens at top level of a ROW() construct; and some nosing around in the parser shows that the same is true in VALUES(). Hence, apply the same workaround already devised for the SELECT-list case, namely to add a forced cast to the appropriate rowtype in these cases. (The alternative of just printing "foo" was rejected because it is difficult to avoid ambiguity against plain columns named "foo".) Back-patch to all supported branches. Branch ------ REL9_3_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/7d0e8720865321fcf124eaac6ef22ef22d13b957 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 35 +++++++++-- src/test/regress/expected/create_view.out | 91 +++++++++++++++++++++++++++++ src/test/regress/sql/create_view.sql | 18 ++++++ 3 files changed, 139 insertions(+), 5 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 12+ messages in thread
* pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( @ 2015-11-15 19:41 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 12+ messages in thread From: Tom Lane @ 2015-11-15 19:41 UTC (permalink / raw) To: pgsql-committers Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES() contexts. Normally ruleutils prints a whole-row Var as "foo.*". We already knew that that doesn't work at top level of a SELECT list, because the parser would treat the "*" as a directive to expand the reference into separate columns, not a whole-row Var. However, Joshua Yanovski points out in bug #13776 that the same thing happens at top level of a ROW() construct; and some nosing around in the parser shows that the same is true in VALUES(). Hence, apply the same workaround already devised for the SELECT-list case, namely to add a forced cast to the appropriate rowtype in these cases. (The alternative of just printing "foo" was rejected because it is difficult to avoid ambiguity against plain columns named "foo".) Back-patch to all supported branches. Branch ------ REL9_2_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/ed824cf80d46ecd5bfd06d4cc65b075328b2db85 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 35 ++++++++-- src/test/regress/expected/create_view.out | 105 +++++++++++++++++------------ src/test/regress/sql/create_view.sql | 15 +++++ 3 files changed, 106 insertions(+), 49 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 12+ messages in thread
* pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( @ 2015-11-15 19:41 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 12+ messages in thread From: Tom Lane @ 2015-11-15 19:41 UTC (permalink / raw) To: pgsql-committers Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES() contexts. Normally ruleutils prints a whole-row Var as "foo.*". We already knew that that doesn't work at top level of a SELECT list, because the parser would treat the "*" as a directive to expand the reference into separate columns, not a whole-row Var. However, Joshua Yanovski points out in bug #13776 that the same thing happens at top level of a ROW() construct; and some nosing around in the parser shows that the same is true in VALUES(). Hence, apply the same workaround already devised for the SELECT-list case, namely to add a forced cast to the appropriate rowtype in these cases. (The alternative of just printing "foo" was rejected because it is difficult to avoid ambiguity against plain columns named "foo".) Back-patch to all supported branches. Branch ------ REL9_1_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/7b21d1bcafef3bb039cef3725c01894070700f99 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 35 ++++++++-- src/test/regress/expected/create_view.out | 101 +++++++++++++++++------------ src/test/regress/sql/create_view.sql | 15 +++++ 3 files changed, 106 insertions(+), 45 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 12+ messages in thread
* pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts. @ 2022-01-13 22:50 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 12+ messages in thread From: Tom Lane @ 2022-01-13 22:50 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ruleutils.c's dumping of whole-row Vars in more contexts. Commit 7745bc352 intended to ensure that whole-row Vars would be printed with "::type" decoration in all contexts where plain "var.*" notation would result in star-expansion, notably in ROW() and VALUES() constructs. However, it missed the case of INSERT with a single-row VALUES, as reported by Timur Khanjanov. Nosing around ruleutils.c, I found a second oversight: the code for RowCompareExpr generates ROW() notation without benefit of an actual RowExpr, and naturally it wasn't in sync :-(. (The code for FieldStore also does this, but we don't expect that to generate strictly parsable SQL anyway, so I left it alone.) Back-patch to all supported branches. Discussion: https://postgr.es/m/efaba6f9-4190-56be-8ff2-7a1674f9194f@intrans.baku.az Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ca14c4184b55cbe2fa79c87174b8064fc5f90874 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 56 +++++++++++++++++++------------ src/test/regress/expected/create_view.out | 19 ++++++++++- src/test/regress/sql/create_view.sql | 5 +++ 3 files changed, 57 insertions(+), 23 deletions(-) ^ permalink raw reply [nested|flat] 12+ messages in thread
* pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts. @ 2022-01-13 22:50 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 12+ messages in thread From: Tom Lane @ 2022-01-13 22:50 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ruleutils.c's dumping of whole-row Vars in more contexts. Commit 7745bc352 intended to ensure that whole-row Vars would be printed with "::type" decoration in all contexts where plain "var.*" notation would result in star-expansion, notably in ROW() and VALUES() constructs. However, it missed the case of INSERT with a single-row VALUES, as reported by Timur Khanjanov. Nosing around ruleutils.c, I found a second oversight: the code for RowCompareExpr generates ROW() notation without benefit of an actual RowExpr, and naturally it wasn't in sync :-(. (The code for FieldStore also does this, but we don't expect that to generate strictly parsable SQL anyway, so I left it alone.) Back-patch to all supported branches. Discussion: https://postgr.es/m/efaba6f9-4190-56be-8ff2-7a1674f9194f@intrans.baku.az Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3a1bfe256575bc1b9e9fd7c10a458084fedbd3a1 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 56 +++++++++++++++++++------------ src/test/regress/expected/create_view.out | 18 +++++++++- src/test/regress/sql/create_view.sql | 5 +++ 3 files changed, 56 insertions(+), 23 deletions(-) ^ permalink raw reply [nested|flat] 12+ messages in thread
* pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts. @ 2022-01-13 22:50 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 12+ messages in thread From: Tom Lane @ 2022-01-13 22:50 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ruleutils.c's dumping of whole-row Vars in more contexts. Commit 7745bc352 intended to ensure that whole-row Vars would be printed with "::type" decoration in all contexts where plain "var.*" notation would result in star-expansion, notably in ROW() and VALUES() constructs. However, it missed the case of INSERT with a single-row VALUES, as reported by Timur Khanjanov. Nosing around ruleutils.c, I found a second oversight: the code for RowCompareExpr generates ROW() notation without benefit of an actual RowExpr, and naturally it wasn't in sync :-(. (The code for FieldStore also does this, but we don't expect that to generate strictly parsable SQL anyway, so I left it alone.) Back-patch to all supported branches. Discussion: https://postgr.es/m/efaba6f9-4190-56be-8ff2-7a1674f9194f@intrans.baku.az Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4aee39ddb8fa748a6beea2bc1b48882990c226a7 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 56 +++++++++++++++++++------------ src/test/regress/expected/create_view.out | 19 ++++++++++- src/test/regress/sql/create_view.sql | 5 +++ 3 files changed, 57 insertions(+), 23 deletions(-) ^ permalink raw reply [nested|flat] 12+ messages in thread
* pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts. @ 2022-01-13 22:50 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 12+ messages in thread From: Tom Lane @ 2022-01-13 22:50 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ruleutils.c's dumping of whole-row Vars in more contexts. Commit 7745bc352 intended to ensure that whole-row Vars would be printed with "::type" decoration in all contexts where plain "var.*" notation would result in star-expansion, notably in ROW() and VALUES() constructs. However, it missed the case of INSERT with a single-row VALUES, as reported by Timur Khanjanov. Nosing around ruleutils.c, I found a second oversight: the code for RowCompareExpr generates ROW() notation without benefit of an actual RowExpr, and naturally it wasn't in sync :-(. (The code for FieldStore also does this, but we don't expect that to generate strictly parsable SQL anyway, so I left it alone.) Back-patch to all supported branches. Discussion: https://postgr.es/m/efaba6f9-4190-56be-8ff2-7a1674f9194f@intrans.baku.az Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3433a1fc76762675170c7d2455ea29e575918898 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 56 +++++++++++++++++++------------ src/test/regress/expected/create_view.out | 18 +++++++++- src/test/regress/sql/create_view.sql | 5 +++ 3 files changed, 56 insertions(+), 23 deletions(-) ^ permalink raw reply [nested|flat] 12+ messages in thread
* pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts. @ 2022-01-13 22:50 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 12+ messages in thread From: Tom Lane @ 2022-01-13 22:50 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ruleutils.c's dumping of whole-row Vars in more contexts. Commit 7745bc352 intended to ensure that whole-row Vars would be printed with "::type" decoration in all contexts where plain "var.*" notation would result in star-expansion, notably in ROW() and VALUES() constructs. However, it missed the case of INSERT with a single-row VALUES, as reported by Timur Khanjanov. Nosing around ruleutils.c, I found a second oversight: the code for RowCompareExpr generates ROW() notation without benefit of an actual RowExpr, and naturally it wasn't in sync :-(. (The code for FieldStore also does this, but we don't expect that to generate strictly parsable SQL anyway, so I left it alone.) Back-patch to all supported branches. Discussion: https://postgr.es/m/efaba6f9-4190-56be-8ff2-7a1674f9194f@intrans.baku.az Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/45a3cefad6380cfc33303b7c294687d4b3ce634e Modified Files -------------- src/backend/utils/adt/ruleutils.c | 56 +++++++++++++++++++------------ src/test/regress/expected/create_view.out | 19 ++++++++++- src/test/regress/sql/create_view.sql | 5 +++ 3 files changed, 57 insertions(+), 23 deletions(-) ^ permalink raw reply [nested|flat] 12+ messages in thread
* pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts. @ 2022-01-13 22:50 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 12+ messages in thread From: Tom Lane @ 2022-01-13 22:50 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ruleutils.c's dumping of whole-row Vars in more contexts. Commit 7745bc352 intended to ensure that whole-row Vars would be printed with "::type" decoration in all contexts where plain "var.*" notation would result in star-expansion, notably in ROW() and VALUES() constructs. However, it missed the case of INSERT with a single-row VALUES, as reported by Timur Khanjanov. Nosing around ruleutils.c, I found a second oversight: the code for RowCompareExpr generates ROW() notation without benefit of an actual RowExpr, and naturally it wasn't in sync :-(. (The code for FieldStore also does this, but we don't expect that to generate strictly parsable SQL anyway, so I left it alone.) Back-patch to all supported branches. Discussion: https://postgr.es/m/efaba6f9-4190-56be-8ff2-7a1674f9194f@intrans.baku.az Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/43c2175121c829c8591fc5117b725f1f22bfb670 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 56 +++++++++++++++++++------------ src/test/regress/expected/create_view.out | 19 ++++++++++- src/test/regress/sql/create_view.sql | 5 +++ 3 files changed, 57 insertions(+), 23 deletions(-) ^ permalink raw reply [nested|flat] 12+ messages in thread
end of thread, other threads:[~2022-01-13 22:50 UTC | newest] Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2015-11-15 19:41 pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( Tom Lane <tgl@sss.pgh.pa.us> 2015-11-15 19:41 pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( Tom Lane <tgl@sss.pgh.pa.us> 2015-11-15 19:41 pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( Tom Lane <tgl@sss.pgh.pa.us> 2015-11-15 19:41 pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( Tom Lane <tgl@sss.pgh.pa.us> 2015-11-15 19:41 pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( Tom Lane <tgl@sss.pgh.pa.us> 2015-11-15 19:41 pgsql: Fix ruleutils.c's dumping of whole-row Vars in ROW() and VALUES( Tom Lane <tgl@sss.pgh.pa.us> 2022-01-13 22:50 pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts. Tom Lane <tgl@sss.pgh.pa.us> 2022-01-13 22:50 pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts. Tom Lane <tgl@sss.pgh.pa.us> 2022-01-13 22:50 pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts. Tom Lane <tgl@sss.pgh.pa.us> 2022-01-13 22:50 pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts. Tom Lane <tgl@sss.pgh.pa.us> 2022-01-13 22:50 pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts. Tom Lane <tgl@sss.pgh.pa.us> 2022-01-13 22:50 pgsql: Fix ruleutils.c's dumping of whole-row Vars in more contexts. 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