Re: Referencing a view? - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: Referencing a view?
Date
Msg-id Pine.BSF.4.21.0107121531020.6545-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Referencing a view?  ("James Orr" <james@lrgmail.com>)
List pgsql-sql
On Thu, 12 Jul 2001, James Orr wrote:

> Hi,
> 
> Is there anyway that you can reference a column in a view for
> referential integrity?  The problem is with the unique thing,
> obviously I can't create a unique index on a view.  Here is what I
> have:

Not right now, and actually you still wouldn't get something that would
work even with a unique index.  We'd have to be able to push the
constraint conditions down into the two tables that you're unioning to
make it work correctly (think about the triggers on the referenced table
for update and delete - which in your case with a unique index would
be safe to put the triggers on all the time in both, but some view
conditions would be such that that wouldn't be sufficient).

You *might* be able to add the triggers manually and have it work.  I
haven't tried, and wouldn't guarantee it at all...




pgsql-sql by date:

Previous
From: "James Orr"
Date:
Subject: Referencing a view?
Next
From: bhuvansql@yahoo.com
Date:
Subject: How can we match a condition among 2 diff. tables?