Re: Views: having a rule call a function vs. using a before trigger

From: "Ken Downs" <ken(at)secdat(dot)com>
To: "Karl O(dot) Pinc" <kop(at)meme(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Views: having a rule call a function vs. using a before trigger
Date: 2007-02-21 14:52:29
Message-ID: jdtinh.7kvha9@dhost2.secdat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

&quot;Karl O. Pinc&quot; &lt;kop(at)meme(dot)com&gt; wrote: &gt; Hi, &gt; &gt;
Postgresql 8.1. &gt; &gt; I'm trying to come up with a generic way &gt; of
inserting into a view, particularly regards &gt; error testing and the
generation of complicated &gt; foreign keys. I don't seem to be having much
luck. &gt; &gt; (I also want to update and delete, but haven't gotten &gt;
that far.)
Before I mount too much of a reply, may I ask in particularwhy you are
targeting views? Reason I ask is that I've gonethrough the same process and
have worked out a generalapproach to implementing all biz logic in
triggers.However, as the biz logic is defined in terms of tables, weattached
all logic always to tables. When for whateverreason the user is going through
a view, the rule sends itback to the base table where the biz logic takes care
of itthere.This avoids attempting to redefine or recast the rules inthe
context of any particular view.So that is why I am asking why in particular
you are asking about views.
&gt; &gt; I thought that, for inserts at least, I could write &gt; a rule
that called a function and have the function &gt; do anything complicated,
raise exceptions, etc. &gt; But I get the error message shown below. &gt;
_________________________________________________________
This mail sent using V-webmail - http://www.v-webmail.org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message cedric 2007-02-21 15:01:16 Re: Slow running to_tsvector (tsearch2 in PG 8.2.3)
Previous Message David Legault 2007-02-21 14:45:26 Re: REVOKE ALL