create rule on select question - Mailing list pgsql-general

From Grzegorz Jaśkiewicz
Subject create rule on select question
Date
Msg-id 2f4958ff0810090209g44a9ee4aw925fa523b9987431@mail.gmail.com
Whole thread Raw
List 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

pgsql-general by date:

Previous
From: Galland Gregoire
Date:
Subject: Run postgresql engine in readonly mode?
Next
From: chrisj
Date:
Subject: ROWTYPE inserts