Re: problems with rules and views - Mailing list pgsql-general

From Tom Lane
Subject Re: problems with rules and views
Date
Msg-id 12155.994688457@sss.pgh.pa.us
Whole thread Raw
In response to problems with rules and views  ("Fabrizio Mazzoni" <fabrizio@macron.com>)
List pgsql-general
"Fabrizio Mazzoni" <fabrizio@macron.com> writes:
> Considering that my view has about 35 columns, is there a way to write a
> rule that does a batch update..?? Something like:

> create rule xxx as
> on update to yyy <-- my view
> do instead
> update to xxx,qqq,zzz; <-- tables from which the view is created

> Or do i have to write a statement for each column...

Just assume that *all* the columns are being updated.  NEW will have the
correct value (possibly the old value) for each column.  You'll probably
need one update command for each source table, but not one per column.

            regards, tom lane

pgsql-general by date:

Previous
From: Steve Wampler
Date:
Subject: fmgr_info: function 2714160: cache lookup failed
Next
From: Jan Wieck
Date:
Subject: Re: Transactions in rules..