create rule on select question

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: "Postgres General List" <pgsql-general(at)postgresql(dot)org>
Subject: create rule on select question
Date: 2008-10-09 09:09:20
Message-ID: 2f4958ff0810090209g44a9ee4aw925fa523b9987431@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

test1=# \d+ testb
View "public.testb"
Column | Type | Modifiers | Description
--------+---------+--------------------+-------------
id | bigint | |
pid | integer | |
b | integer | not null default 1 |
View definition:
SELECT testb.id, testb.pid, 1 AS b
FROM testb
WHERE testb.b <> 0;

test1=# insert into testb(id, pid) values (1, 666);
ERROR: infinite recursion detected in rules for relation "testb"

I have to admit, I don't get that error. Rule is on select, not
insert/update.

--
GJ

Browse pgsql-general by date

  From Date Subject
Next Message chrisj 2008-10-09 13:08:59 ROWTYPE inserts
Previous Message Galland Gregoire 2008-10-09 08:37:51 Run postgresql engine in readonly mode?