How to make ARRAY field with foreign key constraint in SQLAlchemy?
Asked Answered
S

1

8

How to make column with ARRAY(Integer) type, where each integer is primary key from some other table? If it's impossible, how to achieve similar table relationships with other method?

Seepage answered 21/2, 2014 at 10:58 Comment(0)
S
8

As of PostgreSQL 9.3, this is not implemented, see http://blog.2ndquadrant.com/postgresql-9-3-development-array-element-foreign-keys/ One should turn array into other table.

Seepage answered 21/2, 2014 at 11:16 Comment(1)
[link] (https://mcmap.net/q/814504/-using-postgresql-array-to-store-many-to-many-relationship ) Using PostgreSQL array to store many-to-many relationshipConsonantal

© 2022 - 2024 — McMap. All rights reserved.