pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix thinko in construction of old_conpfeqop list. 7+ messages / 1 participants [nested] [flat]
* pgsql: Fix thinko in construction of old_conpfeqop list. @ 2019-07-16 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-07-16 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix thinko in construction of old_conpfeqop list. This should lappend the OIDs, not lcons them; the existing code produced a list in reversed order. This is harmless for single-key FKs or FKs where all the key columns are of the same type, which probably explains how it went unnoticed. But if those conditions are not met, ATAddForeignKeyConstraint would make the wrong decision about whether an existing FK needs to be revalidated. I think it would almost always err in the safe direction by revalidating a constraint that didn't need it. You could imagine scenarios where the pfeqop check was fooled by swapping the types of two FK columns in one ALTER TABLE, but that case would probably be rejected by other tests, so it might be impossible to get to the worst-case scenario where an FK should be revalidated and isn't. (And even then, it's likely to be fine, unless there are weird inconsistencies in the equality behavior of the replacement types.) However, this is a performance bug at least. Noted while poking around to see whether lcons calls could be converted to lappend. This bug is old, dating to commit cb3a7c2b9, so back-patch to all supported branches. Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/3093eb2b83645a083a47ea62769ffd89e31f3664 Modified Files -------------- src/backend/commands/tablecmds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix thinko in construction of old_conpfeqop list. @ 2019-07-16 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-07-16 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix thinko in construction of old_conpfeqop list. This should lappend the OIDs, not lcons them; the existing code produced a list in reversed order. This is harmless for single-key FKs or FKs where all the key columns are of the same type, which probably explains how it went unnoticed. But if those conditions are not met, ATAddForeignKeyConstraint would make the wrong decision about whether an existing FK needs to be revalidated. I think it would almost always err in the safe direction by revalidating a constraint that didn't need it. You could imagine scenarios where the pfeqop check was fooled by swapping the types of two FK columns in one ALTER TABLE, but that case would probably be rejected by other tests, so it might be impossible to get to the worst-case scenario where an FK should be revalidated and isn't. (And even then, it's likely to be fine, unless there are weird inconsistencies in the equality behavior of the replacement types.) However, this is a performance bug at least. Noted while poking around to see whether lcons calls could be converted to lappend. This bug is old, dating to commit cb3a7c2b9, so back-patch to all supported branches. Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e0d13dc6fd71cc647af8aaa82179f1b878f41437 Modified Files -------------- src/backend/commands/tablecmds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix thinko in construction of old_conpfeqop list. @ 2019-07-16 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-07-16 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix thinko in construction of old_conpfeqop list. This should lappend the OIDs, not lcons them; the existing code produced a list in reversed order. This is harmless for single-key FKs or FKs where all the key columns are of the same type, which probably explains how it went unnoticed. But if those conditions are not met, ATAddForeignKeyConstraint would make the wrong decision about whether an existing FK needs to be revalidated. I think it would almost always err in the safe direction by revalidating a constraint that didn't need it. You could imagine scenarios where the pfeqop check was fooled by swapping the types of two FK columns in one ALTER TABLE, but that case would probably be rejected by other tests, so it might be impossible to get to the worst-case scenario where an FK should be revalidated and isn't. (And even then, it's likely to be fine, unless there are weird inconsistencies in the equality behavior of the replacement types.) However, this is a performance bug at least. Noted while poking around to see whether lcons calls could be converted to lappend. This bug is old, dating to commit cb3a7c2b9, so back-patch to all supported branches. Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/46e2a18d0dfd140bfa36e5d543feeac5f5600244 Modified Files -------------- src/backend/commands/tablecmds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix thinko in construction of old_conpfeqop list. @ 2019-07-16 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-07-16 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix thinko in construction of old_conpfeqop list. This should lappend the OIDs, not lcons them; the existing code produced a list in reversed order. This is harmless for single-key FKs or FKs where all the key columns are of the same type, which probably explains how it went unnoticed. But if those conditions are not met, ATAddForeignKeyConstraint would make the wrong decision about whether an existing FK needs to be revalidated. I think it would almost always err in the safe direction by revalidating a constraint that didn't need it. You could imagine scenarios where the pfeqop check was fooled by swapping the types of two FK columns in one ALTER TABLE, but that case would probably be rejected by other tests, so it might be impossible to get to the worst-case scenario where an FK should be revalidated and isn't. (And even then, it's likely to be fine, unless there are weird inconsistencies in the equality behavior of the replacement types.) However, this is a performance bug at least. Noted while poking around to see whether lcons calls could be converted to lappend. This bug is old, dating to commit cb3a7c2b9, so back-patch to all supported branches. Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/583025c3c7e61448d1e6facca770a2171666428c Modified Files -------------- src/backend/commands/tablecmds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix thinko in construction of old_conpfeqop list. @ 2019-07-16 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-07-16 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix thinko in construction of old_conpfeqop list. This should lappend the OIDs, not lcons them; the existing code produced a list in reversed order. This is harmless for single-key FKs or FKs where all the key columns are of the same type, which probably explains how it went unnoticed. But if those conditions are not met, ATAddForeignKeyConstraint would make the wrong decision about whether an existing FK needs to be revalidated. I think it would almost always err in the safe direction by revalidating a constraint that didn't need it. You could imagine scenarios where the pfeqop check was fooled by swapping the types of two FK columns in one ALTER TABLE, but that case would probably be rejected by other tests, so it might be impossible to get to the worst-case scenario where an FK should be revalidated and isn't. (And even then, it's likely to be fine, unless there are weird inconsistencies in the equality behavior of the replacement types.) However, this is a performance bug at least. Noted while poking around to see whether lcons calls could be converted to lappend. This bug is old, dating to commit cb3a7c2b9, so back-patch to all supported branches. Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a6e7eb42d6112ba1c1a9b678a913a9de66a11ff9 Modified Files -------------- src/backend/commands/tablecmds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix thinko in construction of old_conpfeqop list. @ 2019-07-16 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-07-16 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix thinko in construction of old_conpfeqop list. This should lappend the OIDs, not lcons them; the existing code produced a list in reversed order. This is harmless for single-key FKs or FKs where all the key columns are of the same type, which probably explains how it went unnoticed. But if those conditions are not met, ATAddForeignKeyConstraint would make the wrong decision about whether an existing FK needs to be revalidated. I think it would almost always err in the safe direction by revalidating a constraint that didn't need it. You could imagine scenarios where the pfeqop check was fooled by swapping the types of two FK columns in one ALTER TABLE, but that case would probably be rejected by other tests, so it might be impossible to get to the worst-case scenario where an FK should be revalidated and isn't. (And even then, it's likely to be fine, unless there are weird inconsistencies in the equality behavior of the replacement types.) However, this is a performance bug at least. Noted while poking around to see whether lcons calls could be converted to lappend. This bug is old, dating to commit cb3a7c2b9, so back-patch to all supported branches. Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f9208f2469635c372bf3c2ccfc9835dc11bd8c1c Modified Files -------------- src/backend/commands/tablecmds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix thinko in construction of old_conpfeqop list. @ 2019-07-16 22:18 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2019-07-16 22:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix thinko in construction of old_conpfeqop list. This should lappend the OIDs, not lcons them; the existing code produced a list in reversed order. This is harmless for single-key FKs or FKs where all the key columns are of the same type, which probably explains how it went unnoticed. But if those conditions are not met, ATAddForeignKeyConstraint would make the wrong decision about whether an existing FK needs to be revalidated. I think it would almost always err in the safe direction by revalidating a constraint that didn't need it. You could imagine scenarios where the pfeqop check was fooled by swapping the types of two FK columns in one ALTER TABLE, but that case would probably be rejected by other tests, so it might be impossible to get to the worst-case scenario where an FK should be revalidated and isn't. (And even then, it's likely to be fine, unless there are weird inconsistencies in the equality behavior of the replacement types.) However, this is a performance bug at least. Noted while poking around to see whether lcons calls could be converted to lappend. This bug is old, dating to commit cb3a7c2b9, so back-patch to all supported branches. Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/67bd6adcb64b182137142f6fd501024a5b971147 Modified Files -------------- src/backend/commands/tablecmds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2019-07-16 22:18 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-07-16 22:18 pgsql: Fix thinko in construction of old_conpfeqop list. Tom Lane <tgl@sss.pgh.pa.us> 2019-07-16 22:18 pgsql: Fix thinko in construction of old_conpfeqop list. Tom Lane <tgl@sss.pgh.pa.us> 2019-07-16 22:18 pgsql: Fix thinko in construction of old_conpfeqop list. Tom Lane <tgl@sss.pgh.pa.us> 2019-07-16 22:18 pgsql: Fix thinko in construction of old_conpfeqop list. Tom Lane <tgl@sss.pgh.pa.us> 2019-07-16 22:18 pgsql: Fix thinko in construction of old_conpfeqop list. Tom Lane <tgl@sss.pgh.pa.us> 2019-07-16 22:18 pgsql: Fix thinko in construction of old_conpfeqop list. Tom Lane <tgl@sss.pgh.pa.us> 2019-07-16 22:18 pgsql: Fix thinko in construction of old_conpfeqop list. 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