Re: Drop or disable or bypass "_return" rule on select on a view.

From: Luca Ferrari <fluca1978(at)infinito(dot)it>
To: Shashwat Arghode <shashwatarghode(at)gmail(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Drop or disable or bypass "_return" rule on select on a view.
Date: 2015-05-28 10:34:00
Message-ID: CAKoxK+5Jy5F4tLnx6Sr4nk2u7Mvx2-TUSooFxv+-9U7b4w73oQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

On Thu, May 28, 2015 at 8:23 AM, Shashwat Arghode
<shashwatarghode(at)gmail(dot)com> wrote:
> Hi all,
> I am using postgres 9.3.4 and have an on_select rule "_return" on a view.
> I want to drop or disable or bypass that rule.
> Is there any way it can be done without dropping the view??
>
> Because when i try to drop it, it returns
>
> ERROR: cannot drop rule _RETURN on view viewname because view viewname
> requires it
> HINT: You can drop viewname instead.
> CONTEXT: SQL statement "drop rule "_RETURN" on viewname"
> PL/pgSQL function inline_code_block line 12 at EXECUTE statement

I suspect you have messed up names, creating the rule on the target
table instead of another one used as a placeholder.
See the example here:
http://www.postgresql.org/docs/current/static/rules-views.html

Luca

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2015-05-28 13:53:33 Re: Drop or disable or bypass "_return" rule on select on a view.
Previous Message Shashwat Arghode 2015-05-28 09:44:33 Re: Drop or disable or bypass "_return" rule on select on a view.

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2015-05-28 13:53:33 Re: Drop or disable or bypass "_return" rule on select on a view.
Previous Message Shashwat Arghode 2015-05-28 09:44:33 Re: Drop or disable or bypass "_return" rule on select on a view.