From: | Kyle <kyle(at)actarg(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Rule not invoked in 7.1 |
Date: | 2001-01-24 22:14:32 |
Message-ID: | 3A6F53C8.CA9FE05C@actarg.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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?
Attachment | Content-Type | Size |
---|---|---|
kyle.vcf | text/x-vcard | 185 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Wieck | 2001-01-24 23:00:03 | Re: Rules and transactions |
Previous Message | clayton cottingham | 2001-01-24 22:01:30 | Veering OT opinions please XQL versus XML-QL |