Re: Conditional updateable view

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: snacktime <snacktime(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Conditional updateable view
Date: 2007-12-21 14:06:16
Message-ID: b42b73150712210606k11903c72j8f0439a5ab32981c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Dec 15, 2007 8:57 PM, snacktime <snacktime(at)gmail(dot)com> wrote:
> I can't seem to find an example of how to add restrictions to the
> where clause of an updateable view created via the rule system. For
> example I don't want the update to complete if a where clause is
> missing entirely, and in some cases I want to only allow the update if
> the where clause specifies a particular column.
>
> Is there a way to do this?

That's an interesting question. There are some sneaky ways to slip
something into a rule but in your case that doesn't pass the smell
test. ISTM you are trying to enforce integrity in the wrong place.
If you want strict checking on input parameters you can make a
function and have that update the view...inelegant but effective.
Ideally, you don't need this because your constraints are keeping
everything together.

Maybe with some more background I could give you some specific advice.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message beer@cmu.edu 2007-12-21 15:53:49 Restoring 8.0 db to 8.1
Previous Message Greg Smith 2007-12-21 13:37:40 Re: change owner to all object in a schema