DROP TABLE IF EXISTS FKTABLEFORARRAY;
CREATE TABLE FKTABLEFORARRAY (ftest1 int PRIMARY KEY, ftest2 int[]);
ALTER TABLE FKTABLEFORARRAY ADD CONSTRAINT FKARRAY FOREIGN KEY (EACH ELEMENT OF ftest2) REFERENCES PKTABLEFORARRAY;
CREATE INDEX ON FKTABLEFORARRAY USING gin (ftest2 array_ops);
INSERT INTO FKTABLEFORARRAY VALUES (1, '{813}');
INSERT INTO FKTABLEFORARRAY VALUES (2, '{39}');
INSERT INTO FKTABLEFORARRAY VALUES (3, '{864, 608}');
INSERT INTO FKTABLEFORARRAY VALUES (4, '{144, 491, 788}');
INSERT INTO FKTABLEFORARRAY VALUES (5, '{194, 516, 457, 603, 92}');
INSERT INTO FKTABLEFORARRAY VALUES (6, '{782, 917, 758, 351}');
INSERT INTO FKTABLEFORARRAY VALUES (7, '{585, 162}');
INSERT INTO FKTABLEFORARRAY VALUES (8, '{41}');
INSERT INTO FKTABLEFORARRAY VALUES (9, '{995, 744, 666, 56, 570}');
INSERT INTO FKTABLEFORARRAY VALUES (10, '{336}');
