Problems with rules

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Problems with rules
Date: 2000-11-14 09:20:55
Message-ID: 200011140920.eAE9Ktv66402@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Carsten Zerbst (zerbst(at)tu-harburg(dot)de) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
Problems with rules

Long Description
The given code is destilled from a reallife DB. All attempts to define a rule which automatically updates the column aenderungsdatum from table mitglieder on updates failed. The result was every time

psql:ruleerror:17: ERROR: query rewritten 10 times, may contain cycles

Sample Code
DROP TABLE "mitglieder";
CREATE TABLE "mitglieder" (
"mitid" int4 PRIMARY KEY,
"name" character varying(100) NOT NULL,
"vorname" character varying(100),
"aenderungsdatum" date DEFAULT 'now'
);

INSERT INTO "mitglieder" (mitid, name, vorname)
VALUES (42,'Surname','firstname');

DROP RULE "test";
CREATE RULE "test" AS
ON UPDATE TO "mitglieder" WHERE OLD.name <> NEW.name
DO UPDATE "mitglieder" SET "aenderungsdatum" = 'now' ;

UPDATE "mitglieder" SET name='Nachname' where mitid=42;

No file was uploaded with this report

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2000-11-14 09:39:24 NT Binary V7.0 - postgres fails start cause PG_VERSION
Previous Message pgsql-bugs 2000-11-14 06:58:56 no way in LargeObject API to detect short read?