pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. 7+ messages / 1 participants [nested] [flat]
* pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. @ 2018-10-01 15:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-01 15:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER COLUMN TYPE to not open a relation without any lock. If the column being modified is referenced by a foreign key constraint of another table, ALTER TABLE would open the other table (to re-parse the constraint's definition) without having first obtained a lock on it. This was evidently intentional, but that doesn't mean it's really safe. It's especially not safe in 9.3, which pre-dates use of MVCC scans for catalog reads, but even in current releases it doesn't seem like a good idea. We know we'll need AccessExclusiveLock shortly to drop the obsoleted constraint, so just get that a little sooner to close the hole. Per testing with a patch that complains if we open a relation without holding any lock on it. I don't plan to back-patch that patch, but we should close the holes it identifies in all supported branches. Discussion: https://postgr.es/m/2038.1538335244@sss.pgh.pa.us Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/db01fc97ad80e6e29dd5a2d5736cfd3e484f9a30 Modified Files -------------- src/backend/commands/tablecmds.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. @ 2018-10-01 15:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-01 15:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER COLUMN TYPE to not open a relation without any lock. If the column being modified is referenced by a foreign key constraint of another table, ALTER TABLE would open the other table (to re-parse the constraint's definition) without having first obtained a lock on it. This was evidently intentional, but that doesn't mean it's really safe. It's especially not safe in 9.3, which pre-dates use of MVCC scans for catalog reads, but even in current releases it doesn't seem like a good idea. We know we'll need AccessExclusiveLock shortly to drop the obsoleted constraint, so just get that a little sooner to close the hole. Per testing with a patch that complains if we open a relation without holding any lock on it. I don't plan to back-patch that patch, but we should close the holes it identifies in all supported branches. Discussion: https://postgr.es/m/2038.1538335244@sss.pgh.pa.us Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0031e9d6ab8063f0c7fcf420270bd1e86abd7d18 Modified Files -------------- src/backend/commands/tablecmds.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. @ 2018-10-01 15:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-01 15:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER COLUMN TYPE to not open a relation without any lock. If the column being modified is referenced by a foreign key constraint of another table, ALTER TABLE would open the other table (to re-parse the constraint's definition) without having first obtained a lock on it. This was evidently intentional, but that doesn't mean it's really safe. It's especially not safe in 9.3, which pre-dates use of MVCC scans for catalog reads, but even in current releases it doesn't seem like a good idea. We know we'll need AccessExclusiveLock shortly to drop the obsoleted constraint, so just get that a little sooner to close the hole. Per testing with a patch that complains if we open a relation without holding any lock on it. I don't plan to back-patch that patch, but we should close the holes it identifies in all supported branches. Discussion: https://postgr.es/m/2038.1538335244@sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/e27453bd839f3d0f55f94afa554be7066a841ab3 Modified Files -------------- src/backend/commands/tablecmds.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. @ 2018-10-01 15:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-01 15:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER COLUMN TYPE to not open a relation without any lock. If the column being modified is referenced by a foreign key constraint of another table, ALTER TABLE would open the other table (to re-parse the constraint's definition) without having first obtained a lock on it. This was evidently intentional, but that doesn't mean it's really safe. It's especially not safe in 9.3, which pre-dates use of MVCC scans for catalog reads, but even in current releases it doesn't seem like a good idea. We know we'll need AccessExclusiveLock shortly to drop the obsoleted constraint, so just get that a little sooner to close the hole. Per testing with a patch that complains if we open a relation without holding any lock on it. I don't plan to back-patch that patch, but we should close the holes it identifies in all supported branches. Discussion: https://postgr.es/m/2038.1538335244@sss.pgh.pa.us Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4c985549fe82c2a283f5f113747ae2ffd1a95926 Modified Files -------------- src/backend/commands/tablecmds.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. @ 2018-10-01 15:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-01 15:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER COLUMN TYPE to not open a relation without any lock. If the column being modified is referenced by a foreign key constraint of another table, ALTER TABLE would open the other table (to re-parse the constraint's definition) without having first obtained a lock on it. This was evidently intentional, but that doesn't mean it's really safe. It's especially not safe in 9.3, which pre-dates use of MVCC scans for catalog reads, but even in current releases it doesn't seem like a good idea. We know we'll need AccessExclusiveLock shortly to drop the obsoleted constraint, so just get that a little sooner to close the hole. Per testing with a patch that complains if we open a relation without holding any lock on it. I don't plan to back-patch that patch, but we should close the holes it identifies in all supported branches. Discussion: https://postgr.es/m/2038.1538335244@sss.pgh.pa.us Branch ------ REL9_3_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/00d00b5b0d12c14374bd604e9535ea0b539d1cec Modified Files -------------- src/backend/commands/tablecmds.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. @ 2018-10-01 15:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-01 15:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER COLUMN TYPE to not open a relation without any lock. If the column being modified is referenced by a foreign key constraint of another table, ALTER TABLE would open the other table (to re-parse the constraint's definition) without having first obtained a lock on it. This was evidently intentional, but that doesn't mean it's really safe. It's especially not safe in 9.3, which pre-dates use of MVCC scans for catalog reads, but even in current releases it doesn't seem like a good idea. We know we'll need AccessExclusiveLock shortly to drop the obsoleted constraint, so just get that a little sooner to close the hole. Per testing with a patch that complains if we open a relation without holding any lock on it. I don't plan to back-patch that patch, but we should close the holes it identifies in all supported branches. Discussion: https://postgr.es/m/2038.1538335244@sss.pgh.pa.us Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0360c539f2a2a979a98b9bb4ae4b3d8b77ee199b Modified Files -------------- src/backend/commands/tablecmds.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. @ 2018-10-01 15:51 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-10-01 15:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix ALTER COLUMN TYPE to not open a relation without any lock. If the column being modified is referenced by a foreign key constraint of another table, ALTER TABLE would open the other table (to re-parse the constraint's definition) without having first obtained a lock on it. This was evidently intentional, but that doesn't mean it's really safe. It's especially not safe in 9.3, which pre-dates use of MVCC scans for catalog reads, but even in current releases it doesn't seem like a good idea. We know we'll need AccessExclusiveLock shortly to drop the obsoleted constraint, so just get that a little sooner to close the hole. Per testing with a patch that complains if we open a relation without holding any lock on it. I don't plan to back-patch that patch, but we should close the holes it identifies in all supported branches. Discussion: https://postgr.es/m/2038.1538335244@sss.pgh.pa.us Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/26318c4b858a1ba59ffa1d6b186c6302a9153c60 Modified Files -------------- src/backend/commands/tablecmds.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2018-10-01 15:51 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-10-01 15:51 pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-01 15:51 pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-01 15:51 pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-01 15:51 pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-01 15:51 pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-01 15:51 pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-01 15:51 pgsql: Fix ALTER COLUMN TYPE to not open a relation without any lock. 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