Search Postgresql Archives

Rules on select

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I tried to create rule on a view. It should contain a WHERE clause. 
Unfortunately it does not work:

a_4m=# CREATE RULE sharp_p1_rule AS ON SELECT TO sharp
a_4m-#   WHERE part_key = 1
a_4m-#   DO
a_4m-#   INSTEAD SELECT * FROM sharp_p1;
ERROR:  ON SELECT rule may not use OLD

a_4m=# CREATE RULE sharp_p1_rule AS ON SELECT TO sharp
a_4m-#   WHERE NEW.part_key = 1
a_4m-#   DO
a_4m-#   INSTEAD SELECT * FROM sharp_p1;
ERROR:  relation "*NEW*" does not exist

a_4m=# CREATE RULE sharp_p1_rule AS ON SELECT TO sharp
a_4m-#   WHERE OLD.part_key = 1
a_4m-#   DO
a_4m-#   INSTEAD SELECT * FROM sharp_p1;
ERROR:  ON SELECT rule may not use OLD

Is it my mistake, or some feature I did not find in the docs?

regards,

Mariusz

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux