On 7 February 2013 09:02, B=E8rto =EBd S=E8ra <berto.d.sera@gmail.com> wrot=
e:
> Hi
>
>> also a
>> deferrable primary key/unique constraint can't be used as the target
>> for a foreign key.
>
> ehr, why? I mean, I'm positive it cannot be used before an actual
> value is in the record, but what would be the problem, apart from
> that?
>
This restriction is specified in the SQL standard.
I think most of the problems occur with CASCADE actions. E.g., if the
row you refer to isn't currently unique, and then it is updated, how
should those updates cascade to the referencing rows?
There might be something that could be done (perhaps if only RESTRICT
or NO ACTION is specified), but at the moment PostgreSQL doesn't
support it.
Regards,
Dean