Re: Foreign key type checking patch - Mailing list pgsql-patches

From Tom Lane
Subject Re: Foreign key type checking patch
Date
Msg-id 1151.1078164719@sss.pgh.pa.us
Whole thread Raw
In response to Re: Foreign key type checking patch  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: Foreign key type checking patch
List pgsql-patches
Fabien COELHO <coelho@cri.ensmp.fr> writes:
> I must admit that I do not understand your point.

> I wish I would have a WARNING if a foreign key is not declared exactly as
> the key it references.

The reason why people want such a warning is that the RI checks tend to
be slow if it's not the case.  Accordingly, the warning should only
appear if the check is actually going to be slow.

You sound like you think it's a bug that Postgres supports cross-type FK
references at all.  I disagree.  It's a feature, albeit one whose
implementation could stand improvement.  The warning ought to come out
in cases where people are going to be exposed to the implementation
weaknesses.

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: minor doc improvement
Next
From: Stephan Szabo
Date:
Subject: Re: Foreign key type checking patch