pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension 7+ messages / 1 participants [nested] [flat]
* pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension @ 2023-07-10 00:42 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2023-07-10 00:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER EXTENSION SET SCHEMA with objects outside an extension's schema As coded, the code would use as a base comparison the namespace OID from the first object scanned in pg_depend when switching its namespace dependency entry to the new one, and use it as a base of comparison for any follow-up checks. It would also be used as the old namespace OID to switch *from* for the extension's pg_depend entry. Hence, if the first object scanned has a namespace different than the one stored in the extension, we would finish by: - Not checking that the extension objects map with the extension's schema. - Not switching the extension -> namespace dependency entry to the new namespace provided by the user, making ALTER EXTENSION ineffective. This issue exists since this command has been introduced in d9572c4 for relocatable extension, so backpatch all the way down to 11. The test case has been provided by Heikki, that I have tweaked a bit to show the effects on pg_depend for the extension. Reported-by: Heikki Linnakangas Author: Michael Paquier, Heikki Linnakangas Discussion: https://postgr.es/m/20eea594-a05b-4c31-491b-007b6fceef28@iki.fi Backpatch-through: 11 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/55c95f24cd7c91fc80d7c0d2c842c0b633f9bdc9 Modified Files -------------- src/backend/commands/extension.c | 11 ++---- .../test_extensions/expected/test_extensions.out | 43 ++++++++++++++++++++++ .../test_extensions/sql/test_extensions.sql | 32 ++++++++++++++++ 3 files changed, 79 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension @ 2023-07-10 00:42 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2023-07-10 00:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER EXTENSION SET SCHEMA with objects outside an extension's schema As coded, the code would use as a base comparison the namespace OID from the first object scanned in pg_depend when switching its namespace dependency entry to the new one, and use it as a base of comparison for any follow-up checks. It would also be used as the old namespace OID to switch *from* for the extension's pg_depend entry. Hence, if the first object scanned has a namespace different than the one stored in the extension, we would finish by: - Not checking that the extension objects map with the extension's schema. - Not switching the extension -> namespace dependency entry to the new namespace provided by the user, making ALTER EXTENSION ineffective. This issue exists since this command has been introduced in d9572c4 for relocatable extension, so backpatch all the way down to 11. The test case has been provided by Heikki, that I have tweaked a bit to show the effects on pg_depend for the extension. Reported-by: Heikki Linnakangas Author: Michael Paquier, Heikki Linnakangas Discussion: https://postgr.es/m/20eea594-a05b-4c31-491b-007b6fceef28@iki.fi Backpatch-through: 11 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/bd5ddbe8666a11e34ba77e4c1788c4832dcd9a50 Modified Files -------------- src/backend/commands/extension.c | 11 ++---- .../test_extensions/expected/test_extensions.out | 43 ++++++++++++++++++++++ .../test_extensions/sql/test_extensions.sql | 32 ++++++++++++++++ 3 files changed, 79 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension @ 2023-07-10 00:42 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2023-07-10 00:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER EXTENSION SET SCHEMA with objects outside an extension's schema As coded, the code would use as a base comparison the namespace OID from the first object scanned in pg_depend when switching its namespace dependency entry to the new one, and use it as a base of comparison for any follow-up checks. It would also be used as the old namespace OID to switch *from* for the extension's pg_depend entry. Hence, if the first object scanned has a namespace different than the one stored in the extension, we would finish by: - Not checking that the extension objects map with the extension's schema. - Not switching the extension -> namespace dependency entry to the new namespace provided by the user, making ALTER EXTENSION ineffective. This issue exists since this command has been introduced in d9572c4 for relocatable extension, so backpatch all the way down to 11. The test case has been provided by Heikki, that I have tweaked a bit to show the effects on pg_depend for the extension. Reported-by: Heikki Linnakangas Author: Michael Paquier, Heikki Linnakangas Discussion: https://postgr.es/m/20eea594-a05b-4c31-491b-007b6fceef28@iki.fi Backpatch-through: 11 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/235e716bc24df2fbc89f0e99a29f63ec4c58772c Modified Files -------------- src/backend/commands/extension.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension @ 2023-07-10 00:42 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2023-07-10 00:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER EXTENSION SET SCHEMA with objects outside an extension's schema As coded, the code would use as a base comparison the namespace OID from the first object scanned in pg_depend when switching its namespace dependency entry to the new one, and use it as a base of comparison for any follow-up checks. It would also be used as the old namespace OID to switch *from* for the extension's pg_depend entry. Hence, if the first object scanned has a namespace different than the one stored in the extension, we would finish by: - Not checking that the extension objects map with the extension's schema. - Not switching the extension -> namespace dependency entry to the new namespace provided by the user, making ALTER EXTENSION ineffective. This issue exists since this command has been introduced in d9572c4 for relocatable extension, so backpatch all the way down to 11. The test case has been provided by Heikki, that I have tweaked a bit to show the effects on pg_depend for the extension. Reported-by: Heikki Linnakangas Author: Michael Paquier, Heikki Linnakangas Discussion: https://postgr.es/m/20eea594-a05b-4c31-491b-007b6fceef28@iki.fi Backpatch-through: 11 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/914e72e6e8d3e94346f3495dac36d46aa9912bb5 Modified Files -------------- src/backend/commands/extension.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension @ 2023-07-10 00:42 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2023-07-10 00:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER EXTENSION SET SCHEMA with objects outside an extension's schema As coded, the code would use as a base comparison the namespace OID from the first object scanned in pg_depend when switching its namespace dependency entry to the new one, and use it as a base of comparison for any follow-up checks. It would also be used as the old namespace OID to switch *from* for the extension's pg_depend entry. Hence, if the first object scanned has a namespace different than the one stored in the extension, we would finish by: - Not checking that the extension objects map with the extension's schema. - Not switching the extension -> namespace dependency entry to the new namespace provided by the user, making ALTER EXTENSION ineffective. This issue exists since this command has been introduced in d9572c4 for relocatable extension, so backpatch all the way down to 11. The test case has been provided by Heikki, that I have tweaked a bit to show the effects on pg_depend for the extension. Reported-by: Heikki Linnakangas Author: Michael Paquier, Heikki Linnakangas Discussion: https://postgr.es/m/20eea594-a05b-4c31-491b-007b6fceef28@iki.fi Backpatch-through: 11 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d1e0f408cbe25e534c760998c109a56e7502ba05 Modified Files -------------- src/backend/commands/extension.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension @ 2023-07-10 00:42 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2023-07-10 00:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER EXTENSION SET SCHEMA with objects outside an extension's schema As coded, the code would use as a base comparison the namespace OID from the first object scanned in pg_depend when switching its namespace dependency entry to the new one, and use it as a base of comparison for any follow-up checks. It would also be used as the old namespace OID to switch *from* for the extension's pg_depend entry. Hence, if the first object scanned has a namespace different than the one stored in the extension, we would finish by: - Not checking that the extension objects map with the extension's schema. - Not switching the extension -> namespace dependency entry to the new namespace provided by the user, making ALTER EXTENSION ineffective. This issue exists since this command has been introduced in d9572c4 for relocatable extension, so backpatch all the way down to 11. The test case has been provided by Heikki, that I have tweaked a bit to show the effects on pg_depend for the extension. Reported-by: Heikki Linnakangas Author: Michael Paquier, Heikki Linnakangas Discussion: https://postgr.es/m/20eea594-a05b-4c31-491b-007b6fceef28@iki.fi Backpatch-through: 11 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/02021f1b2f65fb86b7f8581f90dd8575fd39daf4 Modified Files -------------- src/backend/commands/extension.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension @ 2023-07-10 00:42 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 7+ messages in thread From: Michael Paquier @ 2023-07-10 00:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER EXTENSION SET SCHEMA with objects outside an extension's schema As coded, the code would use as a base comparison the namespace OID from the first object scanned in pg_depend when switching its namespace dependency entry to the new one, and use it as a base of comparison for any follow-up checks. It would also be used as the old namespace OID to switch *from* for the extension's pg_depend entry. Hence, if the first object scanned has a namespace different than the one stored in the extension, we would finish by: - Not checking that the extension objects map with the extension's schema. - Not switching the extension -> namespace dependency entry to the new namespace provided by the user, making ALTER EXTENSION ineffective. This issue exists since this command has been introduced in d9572c4 for relocatable extension, so backpatch all the way down to 11. The test case has been provided by Heikki, that I have tweaked a bit to show the effects on pg_depend for the extension. Reported-by: Heikki Linnakangas Author: Michael Paquier, Heikki Linnakangas Discussion: https://postgr.es/m/20eea594-a05b-4c31-491b-007b6fceef28@iki.fi Backpatch-through: 11 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f5b075adcf4c20c82a45096d1d9c6a51ca415481 Modified Files -------------- src/backend/commands/extension.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2023-07-10 00:42 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-07-10 00:42 pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension Michael Paquier <michael@paquier.xyz> 2023-07-10 00:42 pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension Michael Paquier <michael@paquier.xyz> 2023-07-10 00:42 pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension Michael Paquier <michael@paquier.xyz> 2023-07-10 00:42 pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension Michael Paquier <michael@paquier.xyz> 2023-07-10 00:42 pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension Michael Paquier <michael@paquier.xyz> 2023-07-10 00:42 pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension Michael Paquier <michael@paquier.xyz> 2023-07-10 00:42 pgsql: Fix ALTER EXTENSION SET SCHEMA with objects outside an extension 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