Search Postgresql Archives

Re: FK pointing to a VIEW

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

 



On 11/10/06, Sandro Dentella <sandro@xxxxxxxx> wrote:
Do I understad correctly that i cannot point a Foreign Key to a view? Which
is the rationale of this?

Blame the sql standard.  Foreign keys are required to reference a
table with a unique constraint, and you can't add a unique constraint
to a view.  While I agree in principle that such a thing should be
able to be done, it simply isn't possible.  (in PostgreSQL, you can't
even add an index to a view, which a unique constraint would depend
on).

merlin


[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