Received: from actarg.com (host25.actarg.com [209.180.91.25] (may be forged)) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0OMEOq79265 for ; Wed, 24 Jan 2001 17:14:24 -0500 (EST) (envelope-from kyle@actarg.com) Received: from chi.actarg.com (IDENT:root@chi.actarg.com [192.168.2.16]) by actarg.com (8.9.3/8.9.3) with ESMTP id PAA31943 for ; Wed, 24 Jan 2001 15:14:21 -0700 Received: from actarg.com (IDENT:kyle@localhost [127.0.0.1]) by chi.actarg.com (8.9.3/8.9.3) with ESMTP id PAA19299 for ; Wed, 24 Jan 2001 15:14:32 -0700 Message-ID: <3A6F53C8.CA9FE05C@actarg.com> Date: Wed, 24 Jan 2001 15:14:32 -0700 From: Kyle Organization: Action Target Inc. X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Rule not invoked in 7.1 Content-Type: multipart/mixed; boundary="------------AAC3D857B40623E0D5D9362E" X-Archive-Number: 200101/341 X-Sequence-Number: 1014 This is a multi-part message in MIME format. --------------AAC3D857B40623E0D5D9362E Content-Type: multipart/alternative; boundary="------------F682CF7F7B85FDEADA50AB14" --------------F682CF7F7B85FDEADA50AB14 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I have a number of views that seemed to work fine in 7.0.3. When I try to do an update to these views under 7.1, I get the following error: ERROR: Cannot update a view without an appropriate rule. For example, there's a view that looks like this: create view pay_req_v_prl as select empl_id,wdate,seq,hours,hot,proj,entby,paytyp,status,poinum,added,rate,otrate,appby,gross,rgross,cost,ttype,expnum,oid as _oid from pay_req create rule pay_req_v_prl_update as on update to pay_req_v_prl where old.status = 'appr' do instead update pay_req set status = new.status, gross = new.gross, cost = new.cost, ttype = new.ttype, expnum = new.expnum, rgross = new.rgross, hot = new.hot where empl_id = old.empl_id and wdate = old.wdate and seq = old.seq; The sql looks like this: update pay_req_v_prl set gross = 90.09 where empl_id = 1010 and wdate = '2001-01-08' and seq = 1; The record it should update does seem to have status = 'appr' and it updates fine on my 7.0.3 box. Any ideas? --------------F682CF7F7B85FDEADA50AB14 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit I have a number of views that seemed to work fine in 7.0.3.  When I try to do an update to these views under 7.1, I get the following error:

ERROR:  Cannot update a view without an appropriate rule.

For example, there's a view that looks like this:

create view pay_req_v_prl as select empl_id,wdate,seq,hours,hot,proj,entby,paytyp,status,poinum,added,rate,otrate,appby,gross,rgross,cost,ttype,expnum,oid as _oid from pay_req

create rule pay_req_v_prl_update as on update to pay_req_v_prl
    where old.status = 'appr' do instead
    update pay_req set status = new.status, gross = new.gross, cost = new.cost,
    ttype = new.ttype, expnum = new.expnum, rgross = new.rgross, hot = new.hot
    where empl_id = old.empl_id and wdate = old.wdate and seq = old.seq;

The sql looks like this:

update pay_req_v_prl set gross = 90.09 where empl_id = 1010 and wdate = '2001-01-08' and seq = 1;

The record it should update does seem to have status = 'appr' and it updates fine on my 7.0.3 box.

Any ideas?

--------------F682CF7F7B85FDEADA50AB14-- --------------AAC3D857B40623E0D5D9362E Content-Type: text/x-vcard; charset=us-ascii; name="kyle.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Kyle Content-Disposition: attachment; filename="kyle.vcf" begin:vcard n:Bateman;Kyle x-mozilla-html:FALSE org:Action Target Inc. adr:;;;;;; version:2.1 email;internet:kyle@actarg.com title:President x-mozilla-cpt:;0 fn:Kyle Bateman end:vcard --------------AAC3D857B40623E0D5D9362E--