fix cluster regression test by properly distributing the clstr_tst
authorTomas Vondra <[email protected]>
Sun, 22 Jan 2017 16:22:43 +0000 (17:22 +0100)
committerTomas Vondra <[email protected]>
Sun, 22 Jan 2017 16:22:43 +0000 (17:22 +0100)
Without the DISTRIBUTE BY clause, the table was distributed by the
first column, resulting in a failure due to the foreign key.

src/test/regress/sql/cluster.sql

index 3532c360c10cb7e6f10830c2632e62405731b577..68435a84273b327a9e1bd4d3f2bc6c4f843aa3c5 100644 (file)
@@ -5,11 +5,12 @@
 CREATE TABLE clstr_tst_s (rf_a SERIAL PRIMARY KEY,
        b INT);
 
-CREATE TABLE clstr_tst (a SERIAL PRIMARY KEY,
+CREATE TABLE clstr_tst (a SERIAL,
        b INT,
        c TEXT,
        d TEXT,
-       CONSTRAINT clstr_tst_con FOREIGN KEY (b) REFERENCES clstr_tst_s);
+       CONSTRAINT clstr_tst_con FOREIGN KEY (b) REFERENCES clstr_tst_s)
+       DISTRIBUTE BY (clstr_tst_con);
 
 CREATE INDEX clstr_tst_b ON clstr_tst (b);
 CREATE INDEX clstr_tst_c ON clstr_tst (c);