Re: problems with rules and views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Fabrizio Mazzoni" <fabrizio(at)macron(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: problems with rules and views
Date: 2001-07-09 14:20:57
Message-ID: 12155.994688457@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Fabrizio Mazzoni" <fabrizio(at)macron(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steve Wampler 2001-07-09 14:28:48 fmgr_info: function 2714160: cache lookup failed
Previous Message Roderick A. Anderson 2001-07-09 14:08:11 The 'C' word