pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Revert applying column aliases to the output of whole-row Vars. 6+ messages / 1 participants [nested] [flat]
* pgsql: Revert applying column aliases to the output of whole-row Vars. @ 2022-03-17 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-03-17 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Revert applying column aliases to the output of whole-row Vars. In commit bf7ca1587, I had the bright idea that we could make the result of a whole-row Var (that is, foo.*) track any column aliases that had been applied to the FROM entry the Var refers to. However, that's not terribly logically consistent, because now the output of the Var is no longer of the named composite type that the Var claims to emit. bf7ca1587 tried to handle that by changing the output tuple values to be labeled with a blessed RECORD type, but that's really pretty disastrous: we can wind up storing such tuples onto disk, whereupon they're not readable by other sessions. The only practical fix I can see is to give up on what bf7ca1587 tried to do, and say that the column names of tuples produced by a whole-row Var are always those of the underlying named composite type, query aliases or no. While this introduces some inconsistencies, it removes others, so it's not that awful in the abstract. What *is* kind of awful is to make such a behavioral change in a back-patched bug fix. But corrupt data is worse, so back-patched it will be. (A workaround available to anyone who's unhappy about this is to introduce an extra level of sub-SELECT, so that the whole-row Var is referring to the sub-SELECT's output and not to a named table type. Then the Var is of type RECORD to begin with and there's no issue.) Per report from Miles Delahunty. The faulty commit dates to 9.5, so back-patch to all supported branches. Discussion: https://postgr.es/m/2950001.1638729947@sss.pgh.pa.us Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1d072bd2030af0f2eaa522449028ff160f71ebf8 Modified Files -------------- src/backend/executor/execExpr.c | 8 ++-- src/backend/executor/execExprInterp.c | 72 ++++++++++++++++------------------ src/backend/executor/execTuples.c | 37 ++++++----------- src/test/regress/expected/rowtypes.out | 23 +---------- src/test/regress/sql/rowtypes.sql | 6 +-- 5 files changed, 54 insertions(+), 92 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Revert applying column aliases to the output of whole-row Vars. @ 2022-03-17 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-03-17 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Revert applying column aliases to the output of whole-row Vars. In commit bf7ca1587, I had the bright idea that we could make the result of a whole-row Var (that is, foo.*) track any column aliases that had been applied to the FROM entry the Var refers to. However, that's not terribly logically consistent, because now the output of the Var is no longer of the named composite type that the Var claims to emit. bf7ca1587 tried to handle that by changing the output tuple values to be labeled with a blessed RECORD type, but that's really pretty disastrous: we can wind up storing such tuples onto disk, whereupon they're not readable by other sessions. The only practical fix I can see is to give up on what bf7ca1587 tried to do, and say that the column names of tuples produced by a whole-row Var are always those of the underlying named composite type, query aliases or no. While this introduces some inconsistencies, it removes others, so it's not that awful in the abstract. What *is* kind of awful is to make such a behavioral change in a back-patched bug fix. But corrupt data is worse, so back-patched it will be. (A workaround available to anyone who's unhappy about this is to introduce an extra level of sub-SELECT, so that the whole-row Var is referring to the sub-SELECT's output and not to a named table type. Then the Var is of type RECORD to begin with and there's no issue.) Per report from Miles Delahunty. The faulty commit dates to 9.5, so back-patch to all supported branches. Discussion: https://postgr.es/m/2950001.1638729947@sss.pgh.pa.us Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/13b54d1e0dde3fff2772e7f776dbd111444511ce Modified Files -------------- src/backend/executor/execExpr.c | 8 ++-- src/backend/executor/execExprInterp.c | 72 ++++++++++++++++------------------ src/backend/executor/execTuples.c | 37 ++++++----------- src/test/regress/expected/rowtypes.out | 23 +---------- src/test/regress/sql/rowtypes.sql | 6 +-- 5 files changed, 54 insertions(+), 92 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Revert applying column aliases to the output of whole-row Vars. @ 2022-03-17 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-03-17 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Revert applying column aliases to the output of whole-row Vars. In commit bf7ca1587, I had the bright idea that we could make the result of a whole-row Var (that is, foo.*) track any column aliases that had been applied to the FROM entry the Var refers to. However, that's not terribly logically consistent, because now the output of the Var is no longer of the named composite type that the Var claims to emit. bf7ca1587 tried to handle that by changing the output tuple values to be labeled with a blessed RECORD type, but that's really pretty disastrous: we can wind up storing such tuples onto disk, whereupon they're not readable by other sessions. The only practical fix I can see is to give up on what bf7ca1587 tried to do, and say that the column names of tuples produced by a whole-row Var are always those of the underlying named composite type, query aliases or no. While this introduces some inconsistencies, it removes others, so it's not that awful in the abstract. What *is* kind of awful is to make such a behavioral change in a back-patched bug fix. But corrupt data is worse, so back-patched it will be. (A workaround available to anyone who's unhappy about this is to introduce an extra level of sub-SELECT, so that the whole-row Var is referring to the sub-SELECT's output and not to a named table type. Then the Var is of type RECORD to begin with and there's no issue.) Per report from Miles Delahunty. The faulty commit dates to 9.5, so back-patch to all supported branches. Discussion: https://postgr.es/m/2950001.1638729947@sss.pgh.pa.us Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1f5ef5ae0806cb75bb0297e46e41765ffa426252 Modified Files -------------- src/backend/executor/execExpr.c | 8 ++-- src/backend/executor/execExprInterp.c | 72 ++++++++++++++++------------------ src/backend/executor/execTuples.c | 37 ++++++----------- src/test/regress/expected/rowtypes.out | 23 +---------- src/test/regress/sql/rowtypes.sql | 6 +-- 5 files changed, 54 insertions(+), 92 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Revert applying column aliases to the output of whole-row Vars. @ 2022-03-17 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-03-17 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Revert applying column aliases to the output of whole-row Vars. In commit bf7ca1587, I had the bright idea that we could make the result of a whole-row Var (that is, foo.*) track any column aliases that had been applied to the FROM entry the Var refers to. However, that's not terribly logically consistent, because now the output of the Var is no longer of the named composite type that the Var claims to emit. bf7ca1587 tried to handle that by changing the output tuple values to be labeled with a blessed RECORD type, but that's really pretty disastrous: we can wind up storing such tuples onto disk, whereupon they're not readable by other sessions. The only practical fix I can see is to give up on what bf7ca1587 tried to do, and say that the column names of tuples produced by a whole-row Var are always those of the underlying named composite type, query aliases or no. While this introduces some inconsistencies, it removes others, so it's not that awful in the abstract. What *is* kind of awful is to make such a behavioral change in a back-patched bug fix. But corrupt data is worse, so back-patched it will be. (A workaround available to anyone who's unhappy about this is to introduce an extra level of sub-SELECT, so that the whole-row Var is referring to the sub-SELECT's output and not to a named table type. Then the Var is of type RECORD to begin with and there's no issue.) Per report from Miles Delahunty. The faulty commit dates to 9.5, so back-patch to all supported branches. Discussion: https://postgr.es/m/2950001.1638729947@sss.pgh.pa.us Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/205214c8b8ccc40b64f9dad4061f12c4dc28fefd Modified Files -------------- src/backend/executor/execExpr.c | 8 ++--- src/backend/executor/execExprInterp.c | 66 +++++++++++++++++----------------- src/backend/executor/execTuples.c | 37 +++++++------------ src/test/regress/expected/rowtypes.out | 23 ++---------- src/test/regress/sql/rowtypes.sql | 6 ++-- 5 files changed, 53 insertions(+), 87 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Revert applying column aliases to the output of whole-row Vars. @ 2022-03-17 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-03-17 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Revert applying column aliases to the output of whole-row Vars. In commit bf7ca1587, I had the bright idea that we could make the result of a whole-row Var (that is, foo.*) track any column aliases that had been applied to the FROM entry the Var refers to. However, that's not terribly logically consistent, because now the output of the Var is no longer of the named composite type that the Var claims to emit. bf7ca1587 tried to handle that by changing the output tuple values to be labeled with a blessed RECORD type, but that's really pretty disastrous: we can wind up storing such tuples onto disk, whereupon they're not readable by other sessions. The only practical fix I can see is to give up on what bf7ca1587 tried to do, and say that the column names of tuples produced by a whole-row Var are always those of the underlying named composite type, query aliases or no. While this introduces some inconsistencies, it removes others, so it's not that awful in the abstract. What *is* kind of awful is to make such a behavioral change in a back-patched bug fix. But corrupt data is worse, so back-patched it will be. (A workaround available to anyone who's unhappy about this is to introduce an extra level of sub-SELECT, so that the whole-row Var is referring to the sub-SELECT's output and not to a named table type. Then the Var is of type RECORD to begin with and there's no issue.) Per report from Miles Delahunty. The faulty commit dates to 9.5, so back-patch to all supported branches. Discussion: https://postgr.es/m/2950001.1638729947@sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/ec62cb0aac5ba31a82339606009ddbd7eb00e2ac Modified Files -------------- src/backend/executor/execExpr.c | 8 ++-- src/backend/executor/execExprInterp.c | 72 ++++++++++++++++------------------ src/backend/executor/execTuples.c | 37 ++++++----------- src/test/regress/expected/rowtypes.out | 23 +---------- src/test/regress/sql/rowtypes.sql | 6 +-- 5 files changed, 54 insertions(+), 92 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Revert applying column aliases to the output of whole-row Vars. @ 2022-03-17 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-03-17 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Revert applying column aliases to the output of whole-row Vars. In commit bf7ca1587, I had the bright idea that we could make the result of a whole-row Var (that is, foo.*) track any column aliases that had been applied to the FROM entry the Var refers to. However, that's not terribly logically consistent, because now the output of the Var is no longer of the named composite type that the Var claims to emit. bf7ca1587 tried to handle that by changing the output tuple values to be labeled with a blessed RECORD type, but that's really pretty disastrous: we can wind up storing such tuples onto disk, whereupon they're not readable by other sessions. The only practical fix I can see is to give up on what bf7ca1587 tried to do, and say that the column names of tuples produced by a whole-row Var are always those of the underlying named composite type, query aliases or no. While this introduces some inconsistencies, it removes others, so it's not that awful in the abstract. What *is* kind of awful is to make such a behavioral change in a back-patched bug fix. But corrupt data is worse, so back-patched it will be. (A workaround available to anyone who's unhappy about this is to introduce an extra level of sub-SELECT, so that the whole-row Var is referring to the sub-SELECT's output and not to a named table type. Then the Var is of type RECORD to begin with and there's no issue.) Per report from Miles Delahunty. The faulty commit dates to 9.5, so back-patch to all supported branches. Discussion: https://postgr.es/m/2950001.1638729947@sss.pgh.pa.us Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5e144cc89b468d845a2dbd7bdd1786c6efcdfd83 Modified Files -------------- src/backend/executor/execExpr.c | 8 ++-- src/backend/executor/execExprInterp.c | 72 ++++++++++++++++------------------ src/backend/executor/execTuples.c | 37 ++++++----------- src/test/regress/expected/rowtypes.out | 23 +---------- src/test/regress/sql/rowtypes.sql | 6 +-- 5 files changed, 54 insertions(+), 92 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2022-03-17 22:18 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-03-17 22:18 pgsql: Revert applying column aliases to the output of whole-row Vars. Tom Lane <tgl@sss.pgh.pa.us> 2022-03-17 22:18 pgsql: Revert applying column aliases to the output of whole-row Vars. Tom Lane <tgl@sss.pgh.pa.us> 2022-03-17 22:18 pgsql: Revert applying column aliases to the output of whole-row Vars. Tom Lane <tgl@sss.pgh.pa.us> 2022-03-17 22:18 pgsql: Revert applying column aliases to the output of whole-row Vars. Tom Lane <tgl@sss.pgh.pa.us> 2022-03-17 22:18 pgsql: Revert applying column aliases to the output of whole-row Vars. Tom Lane <tgl@sss.pgh.pa.us> 2022-03-17 22:18 pgsql: Revert applying column aliases to the output of whole-row Vars. 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