mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-06 23:19:20 +02:00
Simplify FK-to-partitioned regression test query
Avoid a join between relations having the FK to detect FK violation. The planner might optimize this considering the PK must exist on the referenced side at some point, effectively masking a bug this test tries to detect. Tom Lane and Jehan-Guillaume de Rorthais Discussion: https://postgr.es/m/467.1581270529@sss.pgh.pa.us
This commit is contained in:
parent
aab50a7ae4
commit
3f50d5ced3
@ -2456,12 +2456,14 @@ CREATE SCHEMA fkpart9
|
|||||||
INSERT INTO fkpart9.pk VALUES (35);
|
INSERT INTO fkpart9.pk VALUES (35);
|
||||||
INSERT INTO fkpart9.fk VALUES (35);
|
INSERT INTO fkpart9.fk VALUES (35);
|
||||||
DELETE FROM fkpart9.pk WHERE a=35;
|
DELETE FROM fkpart9.pk WHERE a=35;
|
||||||
SELECT fk.fk_a, pk.a
|
SELECT * FROM fkpart9.pk;
|
||||||
FROM fkpart9.fk
|
a
|
||||||
LEFT JOIN fkpart9.pk ON fk.fk_a = pk.a
|
---
|
||||||
WHERE fk.fk_a=35;
|
(0 rows)
|
||||||
fk_a | a
|
|
||||||
------+---
|
SELECT * FROM fkpart9.fk;
|
||||||
|
fk_a
|
||||||
|
------
|
||||||
(0 rows)
|
(0 rows)
|
||||||
|
|
||||||
DROP SCHEMA fkpart9 CASCADE;
|
DROP SCHEMA fkpart9 CASCADE;
|
||||||
|
@ -1735,8 +1735,6 @@ CREATE SCHEMA fkpart9
|
|||||||
INSERT INTO fkpart9.pk VALUES (35);
|
INSERT INTO fkpart9.pk VALUES (35);
|
||||||
INSERT INTO fkpart9.fk VALUES (35);
|
INSERT INTO fkpart9.fk VALUES (35);
|
||||||
DELETE FROM fkpart9.pk WHERE a=35;
|
DELETE FROM fkpart9.pk WHERE a=35;
|
||||||
SELECT fk.fk_a, pk.a
|
SELECT * FROM fkpart9.pk;
|
||||||
FROM fkpart9.fk
|
SELECT * FROM fkpart9.fk;
|
||||||
LEFT JOIN fkpart9.pk ON fk.fk_a = pk.a
|
|
||||||
WHERE fk.fk_a=35;
|
|
||||||
DROP SCHEMA fkpart9 CASCADE;
|
DROP SCHEMA fkpart9 CASCADE;
|
||||||
|
Loading…
Reference in New Issue
Block a user