Re: add constraints to views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Fromm <Andreas(dot)Fromm(at)physik(dot)uni-erlangen(dot)de>
Cc: List pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: add constraints to views
Date: 2003-09-20 17:14:07
Message-ID: 25410.1064078047@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andreas Fromm <Andreas(dot)Fromm(at)physik(dot)uni-erlangen(dot)de> writes:
> No, I mean that the view behaves like a table with the same columns as
> table, but that restricts to records on wich tag is set. To insert a
> record to this "special" table it requires to have field1 set. In other
> words: A record of table is a record of view if tag is set. If tag is
> set, then field1 has also have to have a value. If tag is not set, it
> may have a value for field1, but will not show up in the view. Of course
> I could achive this be triggers, but I thought it could be possible to
> do via constraints on the view.

Constraints on a view are meaningless --- it has no real rows to
constrain. Put the constraints on the underlying table.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-09-20 17:22:00 Re: State of Beta 2
Previous Message nolan 2003-09-20 16:46:11 Re: This mail list and its policies