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

From: Shashwat Arghode <shashwatarghode(at)gmail(dot)com>
To: Faisal Karim <faisalk(at)furniture-pro(dot)com>
Cc: Vincenzo Campanella <vinz65(at)gmail(dot)com>, "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: [SQL] Drop or disable or bypass "_return" rule on select on a view.
Date: 2015-05-29 06:13:06
Message-ID: CAGgbXsxcjMdRYKXMbRfBhq8LYO7Ghk+0FAgQhmLr=MH54NgR7Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

Oh yes. i should update the rule and redirect it accordingly as dropping or
disabling it will leave the view non-functional.
Thanks tom and merlin.
Thanks all.

-shashwat.

On Fri, May 29, 2015 at 1:04 AM, Faisal Karim <faisalk(at)furniture-pro(dot)com>
wrote:

> Did you mean ALTER VIEW Viewname instead of ALTER TABLE Viewname?
>
>
>
> *From:* pgsql-sql-owner(at)postgresql(dot)org [mailto:
> pgsql-sql-owner(at)postgresql(dot)org] *On Behalf Of *Shashwat Arghode
> *Sent:* Thursday, May 28, 2015 4:45 AM
> *To:* Vincenzo Campanella
> *Cc:* pgsql-novice(at)postgresql(dot)org; pgsql-sql(at)postgresql(dot)org
> *Subject:* Re: [SQL] [NOVICE] Drop or disable or bypass "_return" rule on
> select on a view.
>
>
>
> Hi Vincenzo,
> There is no option like disable rule in alter view documentation.
> Still after trying it, it gives same error as follows.
>
> ERROR: "viewname" is not a table
>
> Thanks,
>
> Shashwat.
>
>
>
> On Thu, May 28, 2015 at 2:49 PM, Vincenzo Campanella <vinz65(at)gmail(dot)com>
> wrote:
>
> Il 28.05.2015 08:23, Shashwat Arghode ha scritto:
>
> 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
>
> and i don't want to drop the view.
>
> when i try to disable it using :
> alter table viewname disable rule _return
> it returns
> ERROR: "viewname" is not a table
>
>
> Bypassing rule for a single query or disabling it for some time and then
> enable it will also work for me.
>
> Can it be done ?
>
> Thanks,
> Shashwat.
>
>
>
> Hi Shashwat
>
> I am no PG guru but I guess that, since "viewname" is a view and not a
> table, you should use "alter view" and not "alter table". See:
> http://www.postgresql.org/docs/9.3/static/sql-alterview.html
>
>
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Albe Laurenz 2015-05-29 08:16:57 Re: DLL Problems
Previous Message Hailey Eckstrand 2015-05-28 22:13:16 Selective Replication help

Browse pgsql-sql by date

  From Date Subject
Next Message Steve Midgley 2015-06-01 17:25:29 Re: PG and Temporal
Previous Message Faisal Karim 2015-05-28 19:34:07 Re: [NOVICE] Drop or disable or bypass "_return" rule on select on a view.