Problems with rules

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Problems with rules
Дата
Msg-id 200011140920.eAE9Ktv66402@hub.org
обсуждение исходный текст
Ответы Re: Problems with rules  (Gena Gurchonok <gena@rt.mipt.ru>)
Список pgsql-bugs
Carsten Zerbst (zerbst@tu-harburg.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
aenderungsdatumfrom 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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: no way in LargeObject API to detect short read?
Следующее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: NT Binary V7.0 - postgres fails start cause PG_VERSION