pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW 6+ messages / 1 participants [nested] [flat]
* pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW @ 2021-06-03 06:31 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2021-06-03 06:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Reduce risks of conflicts in internal queries of REFRESH MATVIEW CONCURRENTLY The internal SQL queries used by REFRESH MATERIALIZED VIEW CONCURRENTLY include some aliases for its diff and temporary relations with rather-generic names: diff, newdata, newdata2 and mv. Depending on the queries used for the materialized view, using CONCURRENTLY could lead to some internal failures if the matview query and those internal aliases conflict. Those names have been chosen in 841c29c8. This commit switches instead to a naming pattern which is less likely going to cause conflicts, based on an idea from Thomas Munro, by appending _$ to those aliases. This is not perfect as those new names could still conflict, but at least it has the advantage to keep the code readable and simple while reducing the likelihood of conflicts to be close to zero. Reported-by: Mathis Rudolf Author: Bharath Rupireddy Reviewed-by: Bernd Helmle, Thomas Munro, Michael Paquier Discussion: https://postgr.es/m/109c267a-10d2-3c53-b60e-720fcf44d9e8@credativ.de Backpatch-through: 9.6 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/187682c3217375c9b70417bf3235790f639e8e7e Modified Files -------------- src/backend/commands/matview.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW @ 2021-06-03 06:31 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2021-06-03 06:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Reduce risks of conflicts in internal queries of REFRESH MATVIEW CONCURRENTLY The internal SQL queries used by REFRESH MATERIALIZED VIEW CONCURRENTLY include some aliases for its diff and temporary relations with rather-generic names: diff, newdata, newdata2 and mv. Depending on the queries used for the materialized view, using CONCURRENTLY could lead to some internal failures if the query and those internal aliases conflict. Those names have been chosen in 841c29c8. This commit switches instead to a naming pattern which is less likely going to cause conflicts, based on an idea from Thomas Munro, by appending _$ to those aliases. This is not perfect as those new names could still conflict, but at least it has the advantage to keep the code readable and simple while reducing the likelihood of conflicts to be close to zero. Reported-by: Mathis Rudolf Author: Bharath Rupireddy Reviewed-by: Bernd Helmle, Thomas Munro, Michael Paquier Discussion: https://postgr.es/m/109c267a-10d2-3c53-b60e-720fcf44d9e8@credativ.de Backpatch-through: 9.6 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/75d66d10e0e35529a80d3442081150fcf501bb7d Modified Files -------------- src/backend/commands/matview.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW @ 2021-06-03 06:31 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2021-06-03 06:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Reduce risks of conflicts in internal queries of REFRESH MATVIEW CONCURRENTLY The internal SQL queries used by REFRESH MATERIALIZED VIEW CONCURRENTLY include some aliases for its diff and temporary relations with rather-generic names: diff, newdata, newdata2 and mv. Depending on the queries used for the materialized view, using CONCURRENTLY could lead to some internal failures if the query and those internal aliases conflict. Those names have been chosen in 841c29c8. This commit switches instead to a naming pattern which is less likely going to cause conflicts, based on an idea from Thomas Munro, by appending _$ to those aliases. This is not perfect as those new names could still conflict, but at least it has the advantage to keep the code readable and simple while reducing the likelihood of conflicts to be close to zero. Reported-by: Mathis Rudolf Author: Bharath Rupireddy Reviewed-by: Bernd Helmle, Thomas Munro, Michael Paquier Discussion: https://postgr.es/m/109c267a-10d2-3c53-b60e-720fcf44d9e8@credativ.de Backpatch-through: 9.6 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4ceaa760bd8cf0e19f513a9b6fdf503037d8ff72 Modified Files -------------- src/backend/commands/matview.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW @ 2021-06-03 06:31 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2021-06-03 06:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Reduce risks of conflicts in internal queries of REFRESH MATVIEW CONCURRENTLY The internal SQL queries used by REFRESH MATERIALIZED VIEW CONCURRENTLY include some aliases for its diff and temporary relations with rather-generic names: diff, newdata, newdata2 and mv. Depending on the queries used for the materialized view, using CONCURRENTLY could lead to some internal failures if the query and those internal aliases conflict. Those names have been chosen in 841c29c8. This commit switches instead to a naming pattern which is less likely going to cause conflicts, based on an idea from Thomas Munro, by appending _$ to those aliases. This is not perfect as those new names could still conflict, but at least it has the advantage to keep the code readable and simple while reducing the likelihood of conflicts to be close to zero. Reported-by: Mathis Rudolf Author: Bharath Rupireddy Reviewed-by: Bernd Helmle, Thomas Munro, Michael Paquier Discussion: https://postgr.es/m/109c267a-10d2-3c53-b60e-720fcf44d9e8@credativ.de Backpatch-through: 9.6 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/dbc9dbba56529a915effa6078f9303343aedf3f1 Modified Files -------------- src/backend/commands/matview.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW @ 2021-06-03 06:31 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2021-06-03 06:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Reduce risks of conflicts in internal queries of REFRESH MATVIEW CONCURRENTLY The internal SQL queries used by REFRESH MATERIALIZED VIEW CONCURRENTLY include some aliases for its diff and temporary relations with rather-generic names: diff, newdata, newdata2 and mv. Depending on the queries used for the materialized view, using CONCURRENTLY could lead to some internal failures if the query and those internal aliases conflict. Those names have been chosen in 841c29c8. This commit switches instead to a naming pattern which is less likely going to cause conflicts, based on an idea from Thomas Munro, by appending _$ to those aliases. This is not perfect as those new names could still conflict, but at least it has the advantage to keep the code readable and simple while reducing the likelihood of conflicts to be close to zero. Reported-by: Mathis Rudolf Author: Bharath Rupireddy Reviewed-by: Bernd Helmle, Thomas Munro, Michael Paquier Discussion: https://postgr.es/m/109c267a-10d2-3c53-b60e-720fcf44d9e8@credativ.de Backpatch-through: 9.6 Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/20f70f5581726bdb29cf83ce0b5a7e65d257617f Modified Files -------------- src/backend/commands/matview.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW @ 2021-06-03 06:31 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2021-06-03 06:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Reduce risks of conflicts in internal queries of REFRESH MATVIEW CONCURRENTLY The internal SQL queries used by REFRESH MATERIALIZED VIEW CONCURRENTLY include some aliases for its diff and temporary relations with rather-generic names: diff, newdata, newdata2 and mv. Depending on the queries used for the materialized view, using CONCURRENTLY could lead to some internal failures if the query and those internal aliases conflict. Those names have been chosen in 841c29c8. This commit switches instead to a naming pattern which is less likely going to cause conflicts, based on an idea from Thomas Munro, by appending _$ to those aliases. This is not perfect as those new names could still conflict, but at least it has the advantage to keep the code readable and simple while reducing the likelihood of conflicts to be close to zero. Reported-by: Mathis Rudolf Author: Bharath Rupireddy Reviewed-by: Bernd Helmle, Thomas Munro, Michael Paquier Discussion: https://postgr.es/m/109c267a-10d2-3c53-b60e-720fcf44d9e8@credativ.de Backpatch-through: 9.6 Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d9525c46c89d6a0d85dca0882ced98d12081bc0e Modified Files -------------- src/backend/commands/matview.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2021-06-03 06:31 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-06-03 06:31 pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW Michael Paquier <michael@paquier.xyz> 2021-06-03 06:31 pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW Michael Paquier <michael@paquier.xyz> 2021-06-03 06:31 pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW Michael Paquier <michael@paquier.xyz> 2021-06-03 06:31 pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW Michael Paquier <michael@paquier.xyz> 2021-06-03 06:31 pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW Michael Paquier <michael@paquier.xyz> 2021-06-03 06:31 pgsql: Reduce risks of conflicts in internal queries of REFRESH MATVIEW Michael Paquier <michael@paquier.xyz>
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