Add ORDER BY to multi_foreign_key

pull/2720/head
Onder Kalaci 2019-05-21 15:54:03 +03:00
parent 332ccbf8c1
commit f06a79563d
2 changed files with 2 additions and 2 deletions

View File

@ -671,7 +671,7 @@ ALTER TABLE referencing_table DROP CONSTRAINT test_constraint;
-- test MATCH SIMPLE -- test MATCH SIMPLE
ALTER TABLE referencing_table ADD CONSTRAINT test_constraint FOREIGN KEY(ref_id, id) REFERENCES referenced_table(id, test_column) MATCH SIMPLE; ALTER TABLE referencing_table ADD CONSTRAINT test_constraint FOREIGN KEY(ref_id, id) REFERENCES referenced_table(id, test_column) MATCH SIMPLE;
INSERT INTO referencing_table VALUES(null, 2); INSERT INTO referencing_table VALUES(null, 2);
SELECT * FROM referencing_table; SELECT * FROM referencing_table ORDER BY 1,2;
id | ref_id id | ref_id
----+-------- ----+--------
10 | 1 10 | 1

View File

@ -392,7 +392,7 @@ ALTER TABLE referencing_table DROP CONSTRAINT test_constraint;
-- test MATCH SIMPLE -- test MATCH SIMPLE
ALTER TABLE referencing_table ADD CONSTRAINT test_constraint FOREIGN KEY(ref_id, id) REFERENCES referenced_table(id, test_column) MATCH SIMPLE; ALTER TABLE referencing_table ADD CONSTRAINT test_constraint FOREIGN KEY(ref_id, id) REFERENCES referenced_table(id, test_column) MATCH SIMPLE;
INSERT INTO referencing_table VALUES(null, 2); INSERT INTO referencing_table VALUES(null, 2);
SELECT * FROM referencing_table; SELECT * FROM referencing_table ORDER BY 1,2;
DELETE FROM referencing_table WHERE ref_id = 2; DELETE FROM referencing_table WHERE ref_id = 2;
ALTER TABLE referencing_table DROP CONSTRAINT test_constraint; ALTER TABLE referencing_table DROP CONSTRAINT test_constraint;