Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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";
  ON UPDATE TO "mitglieder" WHERE <>
  DO UPDATE "mitglieder" SET "aenderungsdatum" = 'now' ;
UPDATE "mitglieder" SET name='Nachname' where mitid=42;

No file was uploaded with this report


pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group