Search Postgresql Archives

Re: Need to check each element of an array satisfies a foreign key constraint

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

 



On Tuesday, July 13, 2021, David Gauthier <davegauthierpg@xxxxxxxxx> wrote:

I suppose I could write a stored procedure to do this and call it in a check constraint. But I was wondering if there is something more elegant.


You cannot use a check constraint here as the behavior is not immutable.  You can use a trigger function though.  Or normalize the table and use the built-it foreign key triggers.

David J.
 

[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 Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux