pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedHelp with RULE
3+ messages / 2 participants
[nested] [flat]
* Help with RULE
@ 2001-11-13 08:28 Otakar Kleps <kleps@avonet.cz>
2001-11-15 15:07 ` Re: Help with RULE Stephan Szabo <sszabo@megazone23.bigpanda.com>
0 siblings, 1 reply; 3+ messages in thread
From: Otakar Kleps @ 2001-11-13 08:28 UTC (permalink / raw)
To: pgsql-sql
On Postgres 7.1.3(SUSE Linux 7.0 - 2.2.16) I have this problem:
I have table, for example:
CREATE TABLE tbl_test(
id INTEGERE PRIMARY KEY,
...
_parent INTEGER REFERENCES tbl_test ON DELETE CASCADE,
...
)
Next, I create rule for table tbl_test on event ON DELETE:
CREATE RULE rule_test AS ON DELETE TO tbl_test DO INSERT INTO ...;
Why RULE doesn't DELETE recursive(for a consideration REFERANCES)!?
Please HELP ME!
Thank you
--
Otakar KLEPS AVONET, s.r.o.
-----------------------------------------
tel./fax: 067/7217797
e-mail: kleps@avonet.cz
http://www.avonet.cz http://www.zlin.cz
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Help with RULE
2001-11-13 08:28 Help with RULE Otakar Kleps <kleps@avonet.cz>
@ 2001-11-15 15:07 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2001-11-16 08:10 ` Re: Help with RULE Otakar Kleps <kleps@avonet.cz>
0 siblings, 1 reply; 3+ messages in thread
From: Stephan Szabo @ 2001-11-15 15:07 UTC (permalink / raw)
To: Otakar Kleps <kleps@avonet.cz>; +Cc: pgsql-sql
On Tue, 13 Nov 2001, Otakar Kleps wrote:
> On Postgres 7.1.3(SUSE Linux 7.0 - 2.2.16) I have this problem:
>
> I have table, for example:
>
> CREATE TABLE tbl_test(
> id INTEGERE PRIMARY KEY,
> ...
> _parent INTEGER REFERENCES tbl_test ON DELETE CASCADE,
> ...
> )
>
> Next, I create rule for table tbl_test on event ON DELETE:
> CREATE RULE rule_test AS ON DELETE TO tbl_test DO INSERT INTO ...;
>
> Why RULE doesn't DELETE recursive(for a consideration REFERANCES)!?
I'm running 7.2b2 but I don't see that behavior, can you give a full
test set?
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Help with RULE
2001-11-13 08:28 Help with RULE Otakar Kleps <kleps@avonet.cz>
2001-11-15 15:07 ` Re: Help with RULE Stephan Szabo <sszabo@megazone23.bigpanda.com>
@ 2001-11-16 08:10 ` Otakar Kleps <kleps@avonet.cz>
0 siblings, 0 replies; 3+ messages in thread
From: Otakar Kleps @ 2001-11-16 08:10 UTC (permalink / raw)
To: pgsql-sql; +Cc: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Stephan Szabo wrote:
> On Tue, 13 Nov 2001, Otakar Kleps wrote:
>
>
>>On Postgres 7.1.3(SUSE Linux 7.0 - 2.2.16) I have this problem:
>>
>>I have table, for example:
>>
>>CREATE TABLE tbl_test(
>>id INTEGERE PRIMARY KEY,
>>...
>>_parent INTEGER REFERENCES tbl_test ON DELETE CASCADE,
>>...
>>)
>>
>>Next, I create rule for table tbl_test on event ON DELETE:
>>CREATE RULE rule_test AS ON DELETE TO tbl_test DO INSERT INTO ...;
>>
>>Why RULE doesn't DELETE recursive(for a consideration REFERANCES)!?
>>
>
> I'm running 7.2b2 but I don't see that behavior, can you give a full
> test set?
Example is in attachments.
I try this example:
a) works wrong on pg 7.1.3 on SUSE Linux 7.0 (SELECT version() =>
PostgreSQL 7.1.3 on i686-pc-linux-gnu,compiled by GCC 2.95.2)
b) works OK!!! on pg 7.1.2 on Debian Linux 2.2.19 potato (SELECT
version() => PostgreSQL on i686-pc-linux-gnu,compiled by GCC 2.95.2)
c) works wrong on pg 7.1.3 on Debian Linux 2.2.20 potato (SELECT
version() => PostgreSQL on i686-pc-linux-gnu,compiled by GCC 2.95.2)
I don't uderstand (why this example works on Pg 7.1.2 and on Pg 7.1.3
not works)!
Error is in configure param?
Thanks
PS: sorry form my english
--
Otakar KLEPS AVONET, s.r.o.
-----------------------------------------
tel./fax: 067/7217797
e-mail: kleps@avonet.cz
http://www.avonet.cz http://www.zlin.cz
Attachments:
example.sql (text/plain, 1.7K) download
CREATE TABLE "a_tbl_tree" (
"id" integer NOT NULL,
"_parent" integer,
"_note" character varying(128),
"_picture" character varying(255),
Constraint "a_tbl_tree_pkey" Primary Key ("id")
);
CREATE TABLE "a_tbl_log" (
"_time" timestamp with time zone DEFAULT "timestamp"('now'::text),
"_picture" character varying(255)
);
INSERT INTO "a_tbl_tree" ("id","_parent","_note","_picture") VALUES (0,0,'root','');
INSERT INTO "a_tbl_tree" ("id","_parent","_note","_picture") VALUES (1,0,'Master node 1','mn1.gif');
INSERT INTO "a_tbl_tree" ("id","_parent","_note","_picture") VALUES (2,0,'Master node 2','mn2.gif');
INSERT INTO "a_tbl_tree" ("id","_parent","_note","_picture") VALUES (3,0,'Master node 3','mn3.gif');
INSERT INTO "a_tbl_tree" ("id","_parent","_note","_picture") VALUES (10,1,'Sub-node 1-1','sn11.gif');
INSERT INTO "a_tbl_tree" ("id","_parent","_note","_picture") VALUES (11,1,'Sub-node 1-2','sn12.gif');
INSERT INTO "a_tbl_tree" ("id","_parent","_note","_picture") VALUES (12,1,'Sub-node 1-3','sn13.gif');
INSERT INTO "a_tbl_tree" ("id","_parent","_note","_picture") VALUES (13,1,'Sub-node 1-4','sn14.gif');
INSERT INTO "a_tbl_tree" ("id","_parent","_note","_picture") VALUES (20,2,'Sub-node 2-1','sn21.gif');
INSERT INTO "a_tbl_tree" ("id","_parent","_note","_picture") VALUES (21,2,'Sub-node 2-2','sn22.gif');
INSERT INTO "a_tbl_tree" ("id","_parent","_note","_picture") VALUES (22,2,'Sub-node 2-3','sn23.gif');
INSERT INTO "a_tbl_tree" ("id","_parent","_note","_picture") VALUES (33,3,'Sub-node 3-1','sn31.gif');
CREATE RULE rule_tbl_tree_del AS ON DELETE TO a_tbl_tree DO INSERT INTO a_tbl_log ("_picture") VALUES(OLD._picture);
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-11-16 08:10 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-11-13 08:28 Help with RULE Otakar Kleps <kleps@avonet.cz>
2001-11-15 15:07 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2001-11-16 08:10 ` Otakar Kleps <kleps@avonet.cz>
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