CREATE RULE with WHERE clause - Mailing list pgsql-sql

From Ranieri Mazili
Subject CREATE RULE with WHERE clause
Date
Msg-id 4665611F.9020500@terra.com.br
Whole thread Raw
Responses Re: [GENERAL] CREATE RULE with WHERE clause
Re: [GENERAL] CREATE RULE with WHERE clause
List pgsql-sql
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


pgsql-sql by date:

Previous
From: "Loredana Curugiu"
Date:
Subject: Re: JOIN
Next
From: "Oliveiros Cristina"
Date:
Subject: Re: JOIN