followup on view/rule/delete problem.

From: Pete Leonard <pete(at)hero(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: followup on view/rule/delete problem.
Date: 2001-06-13 16:17:50
Message-ID: Pine.LNX.4.10.10106130913280.30699-100000@hero.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I wanted to thank Tom Lane and Andrew Snow for their help - definitely got
me going in the right direction.

Unfortunately, I'm still not quite there - I'm still experiencing DB
hangs, and was able to duplicate it with the following simplified schema.
Is this a 7.1-specific bug? Is it breaking 7.1.2 as well? Can anyone
offer a workaround?

Thanks everyone,

--pete

Running on FreeBSD-3.4, Postgres 7.1

drop view foobar;
drop table foo;
drop table bar;
drop table log;
drop sequence foo_id_seq;

create sequence foo_id_seq;

create table foo (
id integer default nextval('foo_id_seq') primary key,
name varchar(20)
);

create table bar (
id integer not null constraint foo_chk references foo on delete cascade,
name varchar(20)
);

create table log (
id integer,
action varchar(20)
);

create view foobar as
select f.id, f.name, b.name as barname from foo f, bar b
where f.id=b.id;

create rule delete_foobar as on delete to foobar
do instead (
insert into log (id, action) values (OLD.id, 'deleted');
delete from foo where id=OLD.id;
);

insert into foo (name) values ('aa');
insert into foo (name) values ('bb');
insert into bar (id, name) values (1, 'bar-aa');
insert into bar (id, name) values (2, 'bar-bb');

delete from foobar where id=2;

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-06-13 16:23:29 Re: Re: Does PostgreSQL support EXISTS?
Previous Message Lamar Owen 2001-06-13 16:08:31 Re: Oracle news article