On Sat, 10 Feb 2007, Tom Lane wrote:

> Stephan Szabo <[EMAIL PROTECTED]> writes:
> > One side question is what should we do about the
> > places in the current system where it checks for the key sets being empty?
>
> I don't see that this affects that either way.  I can't quite imagine
> what the semantics would be, though --- there's no such thing as a
> unique constraint with no columns, so how can there be an RI constraint
> with none?

Well, the code currently has checks with comments based on SQL3
text AFAICT.
        /* ----------
         * SQL3 11.9 <referential constraint definition>
         *      General rules 2) a):
         *              If Rf and Rt are empty (no columns to compare given)
         *              constraint is true if 0 < (SELECT COUNT(*) FROM T)
         *
         *      Note: The special case that no columns are given cannot
         *              occur up to now in Postgres, it's just there for
         *              future enhancements.
         * ----------
         */
The reason I was wondering is that it uses tgnargs == 4 as the check, and
if we change the meanings of tgnargs, we'd need to change the check.
Personally, I think we should probably just pull out the special case for
now, but thought it should be brought up.

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to