Re: Foreign keys for non-default datatypes
Stephan Szabo <sszabo@megazone.bigpanda.com>
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Date: 2006-03-04T00:37:25Z
Lists: pgsql-hackers
On Fri, 3 Mar 2006, Tom Lane wrote: > BTW, I had another thought about this: if we go this way, then the plans > associated with RI check queries would essentially always be trivial > index lookups (for everything except RI_Initial_Check). It'd be within > the realm of feasibility to throw away the current cached-plan RI > infrastructure and simply do direct indexscans, in the style that we > currently use for most system-catalog accesses. Would we have to do anything odd if we want to be testing only some of the index columns and possibly not in the index order (like match partial where some of the fk side is null)? I don't honestly see us doing match partial any time soon, but I'd like to have an idea of what'd be involved. > If we did this then RI checks would no longer be subvertible by rules or > user triggers. I don't think that it'd really help because it's the actions that are generally subvertible not the checks and since those are looking at the potentially not indexed fk side, I don't think the above would apply.