pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Show 'AS "?column?"' explicitly when it's important. 6+ messages / 1 participants [nested] [flat]
* pgsql: Show 'AS "?column?"' explicitly when it's important. @ 2022-05-21 18:46 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-05-21 18:46 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Show 'AS "?column?"' explicitly when it's important. ruleutils.c was coded to suppress the AS label for a SELECT output expression if the column name is "?column?", which is the parser's fallback if it can't think of something better. This is fine, and avoids ugly clutter, so long as (1) nothing further up in the parse tree relies on that column name or (2) the same fallback would be assigned when the rule or view definition is reloaded. Unfortunately (2) is far from certain, both because ruleutils.c might print the expression in a different form from how it was originally written and because FigureColname's rules might change in future releases. So we shouldn't rely on that. Detecting exactly whether there is any outer-level use of a SELECT column name would be rather expensive. This patch takes the simpler approach of just passing down a flag indicating whether there *could* be any outer use; for example, the output column names of a SubLink are not referenceable, and we also do not care about the names exposed by the right-hand side of a setop. This is sufficient to suppress unwanted clutter in all but one case in the regression tests. That seems like reasonable evidence that it won't be too much in users' faces, while still fixing the cases we need to fix. Per bug #17486 from Nicolas Lutic. This issue is ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17486-1ad6fd786728b8af@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c7461fc25558832dd347a9c8150b0f1ed85e36e8 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 107 +++++++++++++++++++++------------- src/test/regress/expected/matview.out | 4 +- 2 files changed, 70 insertions(+), 41 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Show 'AS "?column?"' explicitly when it's important. @ 2022-05-21 18:46 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-05-21 18:46 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Show 'AS "?column?"' explicitly when it's important. ruleutils.c was coded to suppress the AS label for a SELECT output expression if the column name is "?column?", which is the parser's fallback if it can't think of something better. This is fine, and avoids ugly clutter, so long as (1) nothing further up in the parse tree relies on that column name or (2) the same fallback would be assigned when the rule or view definition is reloaded. Unfortunately (2) is far from certain, both because ruleutils.c might print the expression in a different form from how it was originally written and because FigureColname's rules might change in future releases. So we shouldn't rely on that. Detecting exactly whether there is any outer-level use of a SELECT column name would be rather expensive. This patch takes the simpler approach of just passing down a flag indicating whether there *could* be any outer use; for example, the output column names of a SubLink are not referenceable, and we also do not care about the names exposed by the right-hand side of a setop. This is sufficient to suppress unwanted clutter in all but one case in the regression tests. That seems like reasonable evidence that it won't be too much in users' faces, while still fixing the cases we need to fix. Per bug #17486 from Nicolas Lutic. This issue is ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17486-1ad6fd786728b8af@postgresql.org Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6f7eec1193f8ddafb6d7ff495d3ce2eb01202a86 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 104 +++++++++++++++++++++------------- src/test/regress/expected/matview.out | 4 +- 2 files changed, 68 insertions(+), 40 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Show 'AS "?column?"' explicitly when it's important. @ 2022-05-21 18:46 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-05-21 18:46 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Show 'AS "?column?"' explicitly when it's important. ruleutils.c was coded to suppress the AS label for a SELECT output expression if the column name is "?column?", which is the parser's fallback if it can't think of something better. This is fine, and avoids ugly clutter, so long as (1) nothing further up in the parse tree relies on that column name or (2) the same fallback would be assigned when the rule or view definition is reloaded. Unfortunately (2) is far from certain, both because ruleutils.c might print the expression in a different form from how it was originally written and because FigureColname's rules might change in future releases. So we shouldn't rely on that. Detecting exactly whether there is any outer-level use of a SELECT column name would be rather expensive. This patch takes the simpler approach of just passing down a flag indicating whether there *could* be any outer use; for example, the output column names of a SubLink are not referenceable, and we also do not care about the names exposed by the right-hand side of a setop. This is sufficient to suppress unwanted clutter in all but one case in the regression tests. That seems like reasonable evidence that it won't be too much in users' faces, while still fixing the cases we need to fix. Per bug #17486 from Nicolas Lutic. This issue is ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17486-1ad6fd786728b8af@postgresql.org Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/fefd5463173a6ca598ae206b13a505297d9efecb Modified Files -------------- src/backend/utils/adt/ruleutils.c | 100 ++++++++++++++++++++++------------ src/test/regress/expected/matview.out | 4 +- 2 files changed, 66 insertions(+), 38 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Show 'AS "?column?"' explicitly when it's important. @ 2022-05-21 18:46 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-05-21 18:46 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Show 'AS "?column?"' explicitly when it's important. ruleutils.c was coded to suppress the AS label for a SELECT output expression if the column name is "?column?", which is the parser's fallback if it can't think of something better. This is fine, and avoids ugly clutter, so long as (1) nothing further up in the parse tree relies on that column name or (2) the same fallback would be assigned when the rule or view definition is reloaded. Unfortunately (2) is far from certain, both because ruleutils.c might print the expression in a different form from how it was originally written and because FigureColname's rules might change in future releases. So we shouldn't rely on that. Detecting exactly whether there is any outer-level use of a SELECT column name would be rather expensive. This patch takes the simpler approach of just passing down a flag indicating whether there *could* be any outer use; for example, the output column names of a SubLink are not referenceable, and we also do not care about the names exposed by the right-hand side of a setop. This is sufficient to suppress unwanted clutter in all but one case in the regression tests. That seems like reasonable evidence that it won't be too much in users' faces, while still fixing the cases we need to fix. Per bug #17486 from Nicolas Lutic. This issue is ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17486-1ad6fd786728b8af@postgresql.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/bb2c04676be0efe87eafa7342dc1143cb9fb2d20 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 100 ++++++++++++++++++++++------------ src/test/regress/expected/matview.out | 4 +- 2 files changed, 66 insertions(+), 38 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Show 'AS "?column?"' explicitly when it's important. @ 2022-05-21 18:46 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-05-21 18:46 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Show 'AS "?column?"' explicitly when it's important. ruleutils.c was coded to suppress the AS label for a SELECT output expression if the column name is "?column?", which is the parser's fallback if it can't think of something better. This is fine, and avoids ugly clutter, so long as (1) nothing further up in the parse tree relies on that column name or (2) the same fallback would be assigned when the rule or view definition is reloaded. Unfortunately (2) is far from certain, both because ruleutils.c might print the expression in a different form from how it was originally written and because FigureColname's rules might change in future releases. So we shouldn't rely on that. Detecting exactly whether there is any outer-level use of a SELECT column name would be rather expensive. This patch takes the simpler approach of just passing down a flag indicating whether there *could* be any outer use; for example, the output column names of a SubLink are not referenceable, and we also do not care about the names exposed by the right-hand side of a setop. This is sufficient to suppress unwanted clutter in all but one case in the regression tests. That seems like reasonable evidence that it won't be too much in users' faces, while still fixing the cases we need to fix. Per bug #17486 from Nicolas Lutic. This issue is ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17486-1ad6fd786728b8af@postgresql.org Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f3b8d7244ae1ede5480b2fc94f207bcc62608549 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 100 ++++++++++++++++++++++------------ src/test/regress/expected/matview.out | 4 +- 2 files changed, 66 insertions(+), 38 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Show 'AS "?column?"' explicitly when it's important. @ 2022-05-21 18:46 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2022-05-21 18:46 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Show 'AS "?column?"' explicitly when it's important. ruleutils.c was coded to suppress the AS label for a SELECT output expression if the column name is "?column?", which is the parser's fallback if it can't think of something better. This is fine, and avoids ugly clutter, so long as (1) nothing further up in the parse tree relies on that column name or (2) the same fallback would be assigned when the rule or view definition is reloaded. Unfortunately (2) is far from certain, both because ruleutils.c might print the expression in a different form from how it was originally written and because FigureColname's rules might change in future releases. So we shouldn't rely on that. Detecting exactly whether there is any outer-level use of a SELECT column name would be rather expensive. This patch takes the simpler approach of just passing down a flag indicating whether there *could* be any outer use; for example, the output column names of a SubLink are not referenceable, and we also do not care about the names exposed by the right-hand side of a setop. This is sufficient to suppress unwanted clutter in all but one case in the regression tests. That seems like reasonable evidence that it won't be too much in users' faces, while still fixing the cases we need to fix. Per bug #17486 from Nicolas Lutic. This issue is ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17486-1ad6fd786728b8af@postgresql.org Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7686403b43ca6ad8ae8e5c76273ec4826e2f2dce Modified Files -------------- src/backend/utils/adt/ruleutils.c | 100 ++++++++++++++++++++++------------ src/test/regress/expected/matview.out | 4 +- 2 files changed, 66 insertions(+), 38 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2022-05-21 18:46 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-05-21 18:46 pgsql: Show 'AS "?column?"' explicitly when it's important. Tom Lane <tgl@sss.pgh.pa.us> 2022-05-21 18:46 pgsql: Show 'AS "?column?"' explicitly when it's important. Tom Lane <tgl@sss.pgh.pa.us> 2022-05-21 18:46 pgsql: Show 'AS "?column?"' explicitly when it's important. Tom Lane <tgl@sss.pgh.pa.us> 2022-05-21 18:46 pgsql: Show 'AS "?column?"' explicitly when it's important. Tom Lane <tgl@sss.pgh.pa.us> 2022-05-21 18:46 pgsql: Show 'AS "?column?"' explicitly when it's important. Tom Lane <tgl@sss.pgh.pa.us> 2022-05-21 18:46 pgsql: Show 'AS "?column?"' explicitly when it's important. 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