Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b2304a7

Browse files
committed
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
1 parent 53b01ac commit b2304a7

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/test/regress/expected/foreign_key.out

+8-6
Original file line numberDiff line numberDiff line change
@@ -2456,12 +2456,14 @@ CREATE SCHEMA fkpart9
24562456
INSERT INTO fkpart9.pk VALUES (35);
24572457
INSERT INTO fkpart9.fk VALUES (35);
24582458
DELETE FROM fkpart9.pk WHERE a=35;
2459-
SELECT fk.fk_a, pk.a
2460-
FROM fkpart9.fk
2461-
LEFT JOIN fkpart9.pk ON fk.fk_a = pk.a
2462-
WHERE fk.fk_a=35;
2463-
fk_a | a
2464-
------+---
2459+
SELECT * FROM fkpart9.pk;
2460+
a
2461+
---
2462+
(0 rows)
2463+
2464+
SELECT * FROM fkpart9.fk;
2465+
fk_a
2466+
------
24652467
(0 rows)
24662468

24672469
DROP SCHEMA fkpart9 CASCADE;

src/test/regress/sql/foreign_key.sql

+2-4
Original file line numberDiff line numberDiff line change
@@ -1735,8 +1735,6 @@ CREATE SCHEMA fkpart9
17351735
INSERT INTO fkpart9.pk VALUES (35);
17361736
INSERT INTO fkpart9.fk VALUES (35);
17371737
DELETE FROM fkpart9.pk WHERE a=35;
1738-
SELECT fk.fk_a, pk.a
1739-
FROM fkpart9.fk
1740-
LEFT JOIN fkpart9.pk ON fk.fk_a = pk.a
1741-
WHERE fk.fk_a=35;
1738+
SELECT * FROM fkpart9.pk;
1739+
SELECT * FROM fkpart9.fk;
17421740
DROP SCHEMA fkpart9 CASCADE;

0 commit comments

Comments
 (0)