DROP TABLE IF EXISTS FKTABLEFORARRAY;
DROP TABLE IF EXISTS MANY2MANY;
CREATE TABLE FKTABLEFORARRAY (ftest1 int PRIMARY KEY, ftest2 int);
CREATE TABLE MANY2MANY (mtest1 SERIAL PRIMARY KEY, 
    mtest2 int references PKTABLEFORARRAY(ptest1), 
    mtest3 int references FKTABLEFORARRAY(ftest1)
);
INSERT INTO FKTABLEFORARRAY VALUES (1, 1);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (1, 73);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (1, 509);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (1, 775);
INSERT INTO FKTABLEFORARRAY VALUES (2, 2);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (2, 310);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (2, 413);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (2, 552);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (2, 512);
INSERT INTO FKTABLEFORARRAY VALUES (3, 3);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (3, 258);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (3, 854);
INSERT INTO FKTABLEFORARRAY VALUES (4, 4);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (4, 279);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (4, 222);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (4, 346);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (4, 500);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (4, 448);
INSERT INTO FKTABLEFORARRAY VALUES (5, 5);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (5, 49);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (5, 140);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (5, 148);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (5, 911);
INSERT INTO FKTABLEFORARRAY VALUES (6, 6);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (6, 18);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (6, 424);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (6, 531);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (6, 599);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (6, 654);
INSERT INTO FKTABLEFORARRAY VALUES (7, 7);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (7, 271);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (7, 659);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (7, 421);
INSERT INTO FKTABLEFORARRAY VALUES (8, 8);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (8, 19);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (8, 440);
INSERT INTO FKTABLEFORARRAY VALUES (9, 9);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (9, 351);
INSERT INTO FKTABLEFORARRAY VALUES (10, 10);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (10, 985);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (10, 687);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (10, 409);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (10, 865);
INSERT INTO MANY2MANY (mtest3, mtest2) VALUES (10, 561);
