agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Vincenzo Campanella <vinz65@gmail.com>
To: Shashwat Arghode <shashwatarghode@gmail.com>
To: pgsql-novice@postgresql.org
To: pgsql-sql@postgresql.org
Subject: Re: Drop or disable or bypass "_return" rule on select on a view.
Date: Thu, 28 May 2015 11:19:58 +0200
Message-ID: <5566DDBE.5040304@gmail.com> (raw)
In-Reply-To: <CAGgbXsz-kN=j67bi93_38P0j3cFkJw61YnBZJC3LYGmM-LZj0A@mail.gmail.com>
References: <CAGgbXsz-kN=j67bi93_38P0j3cFkJw61YnBZJC3LYGmM-LZj0A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-novice>

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




-- 
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice



view thread (8+ messages)  latest in thread

Message-ID: <5566DDBE.5040304@gmail.com>
Permalink:  ../5566DDBE.5040304@gmail.com/
Also on:    postgresql.org/message-id/5566DDBE.5040304@gmail.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: vinz65@gmail.com, shashwatarghode@gmail.com, pgsql-novice@postgresql.org
  Subject: Re: Drop or disable or bypass "_return" rule on select on a view.
  In-Reply-To: <5566DDBE.5040304@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox