Postgres creating a Table with an array of foreign keys
问题 I am making a table named "routes". I want it to be able to contain a list of flights in it. The flights' details are in the flights tables. I want "flight" to be an array of foreign key ids from the flights table. So, I have this code: CREATE TABLE routes ( id SERIAL PRIMARY KEY, flight integer[] ELEMENT REFERENCES flights, user CHARACTER VARYING(50) ); But, it gives the error: ERROR: syntax error at or near "ELEMENT" LINE 2: id SERIAL PRIMARY KEY, flight integer[] ELEMENT REFERENC... I am