pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kyle <kyle@actarg.com>
To: pgsql-sql@postgresql.org
Subject: Rule not invoked in 7.1
Date: Wed, 24 Jan 2001 15:14:32 -0700
Message-ID: <3A6F53C8.CA9FE05C@actarg.com> (raw)

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?

Attachments:

kyle.vcf (text/x-vcard, 184B) download 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

view thread (10+ messages)  latest in thread

Message-ID: <3A6F53C8.CA9FE05C@actarg.com>
Permalink:  ../3A6F53C8.CA9FE05C@actarg.com/
Also on:    postgresql.org/message-id/3A6F53C8.CA9FE05C@actarg.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: kyle@actarg.com
  Subject: Re: Rule not invoked in 7.1
  In-Reply-To: <3A6F53C8.CA9FE05C@actarg.com>
  References: <3A6F53C8.CA9FE05C@actarg.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox