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

寵の児 提交于 2019-11-30 03:28:06

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/21932489/how-to-make-array-field-with-foreign-key-constraint-in-sqlalchemy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!