bug (?) with RULEs with WHERE

From: Kovacs Zoltan <kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: bug (?) with RULEs with WHERE
Date: 2001-10-27 11:10:50
Message-ID: Pine.LNX.4.21.0110271256380.4110-100000@pc10.radnoti-szeged.sulinet.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I cannot use RULEs with WHERE clauses. What's wrong? Is this a bug? I also
had this problem with 7.1.1. The documentation says this should work.

foo=# SELECT version();
version
---------------------------------------------------------------------
PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC egcs-2.91.66
(1 row)

foo=# CREATE TABLE a(foo integer);
CREATE
foo=# CREATE TABLE b(foo integer);
CREATE
foo=# CREATE VIEW c AS SELECT foo FROM a;
CREATE
foo=# CREATE RULE d AS ON INSERT TO c WHERE new.foo=5 DO INSTEAD SELECT foo FROM b;
CREATE
foo=# INSERT INTO c VALUES (5);
ERROR: Cannot insert into a view without an appropriate rule
foo=# INSERT INTO c VALUES (6);
ERROR: Cannot insert into a view without an appropriate rule

TIA, Zoltan

--
Kov\'acs, Zolt\'an
kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu
http://www.math.u-szeged.hu/~kovzol
ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rene Pijlman 2001-10-27 11:50:28 Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER
Previous Message Christopher Kings-Lynne 2001-10-27 10:05:48 Re: consistent naming of components