Search Postgresql Archives

CREATE RULE with WHERE clause

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

 



Hello,

I need to create a rule, but I need that it have a WHERE clause, how bellow:


CREATE RULE rule_role_sul AS
   ON SELECT TO t1 WHERE roles = 'role_sul'
DO INSTEAD SELECT field1, field2 FROM t2;

CREATE RULE rule_role_sul AS
   ON SELECT TO t1 WHERE roles = 'role_norte'
DO INSTEAD SELECT field3, field4 FROM t2;

Someone knows how can I do it?

I appreciate any help

Thanks


[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