Search Postgresql Archives

Re: Array of foreign key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I don't think you understand how Foreign Key constraints work in PostgreSQL.
PostgreSQL will prevent any insert where the value of a column is not within the FK table.
So you DO NOT need a check constraint or trigger.


I thought the OP was asking for this feature ("Support for Array ELEMENT Foreign Keys"):

https://www.postgresql.org/message-id/flat/1343842863.5162.4.camel@xxxxxxxxxxxxxxxxxxxxx#1343842863.5162.4.camel@xxxxxxxxxxxxxxxxxxxxx 

which would be super-handy, but doesn't actually exist.  You can enforce it yourself with a trigger on both tables, but I still hope this someday gets included into Postgres!

Ken


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux