Search Postgresql Archives

Re: PG 9.1 - FK + Check constraint

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

 



On Tue, Jul 18, 2017 at 6:56 PM, Patrick B <patrickbakerbr@xxxxxxxxx> wrote:

Another solution would be to create an IMMUTABLE functiondoing the check and use that in a CHECK constraint [1].

Why do you need an FK constraint?  Why can you not use a data modification trigger?

Placing the subquery within a mis-defined immutable function so PostgreSQL is oblivious to it doesn't do anything to overcome the fact that the system is not designed to have check constraints with subqueries.  You are likely to get burned - commonly during backup restoration but there is no guarantees as to why might happen.

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

  Powered by Linux