Re: Feature request: drop rules

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Thom Brown <thombrown(at)gmail(dot)com>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Feature request: drop rules
Date: 2010-07-21 13:26:54
Message-ID: c0cc3d0232920416a84cd805d37e850c@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Wed, 21 Jul 2010 14:12:37 +0100, Thom Brown <thombrown(at)gmail(dot)com>
wrote:
> On 21 July 2010 14:06, Guillaume Lelarge <guillaume(at)lelarge(dot)info> wrote:
>> On Wed, 21 Jul 2010 14:04:09 +0100, Dave Page <dpage(at)pgadmin(dot)org>
wrote:
>>> On Wed, Jul 21, 2010 at 2:01 PM, Thom Brown <thombrown(at)gmail(dot)com>
wrote:
>>>> On 21 July 2010 10:45, Thom Brown <thombrown(at)gmail(dot)com> wrote:
>>>>> On 21 July 2010 10:38, Guillaume Lelarge <guillaume(at)lelarge(dot)info>
>> wrote:
>>>>>> On Wed, 21 Jul 2010 10:23:33 +0100, Thom Brown
<thombrown(at)gmail(dot)com>
>>>>>> wrote:
>>>>>>> On 21 July 2010 10:03, Guillaume Lelarge <guillaume(at)lelarge(dot)info>
>>>>>>> wrote:
>>>>>>>> On Wed, 21 Jul 2010 09:43:33 +0100, Thom Brown
>> <thombrown(at)gmail(dot)com>
>>>>>>>> wrote:
>>>>>>>>> I noticed you can't drop rules from the GUI.  Could this be
>>>>>>>>> added?
>>>>>>>>>
>>>>>>>>
>>>>>>>> It's already available. I see it, and I can drop a rule.
>>>>>>>>
>>>>>>>> --
>>>>>>>
>>>>>>> Hmm... then it might be my version.  I'm using 1.12.0 beta 3 rev
>>>>>>> 8448.
>>>>>>> (see attached)
>>>>>>>
>>>>>>
>>>>>> You also don't have the right to create a rule. Are you connected
>> with
>>>>>> a
>>>>>> superuser? If not, try with this. And what's your release of
>>>>>> PostgreSQL?
>>>>>>
>>>>>
>>>>> Yes, I'm connected as a superuser, and created the rule as the
>>>>> superuser too.  I can manually drop it.  I've tested this using
>>>>> PostgreSQL 8.3.1, 8.4.4 and 9.0 beta 3.
>>>>>
>>>>> If I use pgAdmin III 1.10.3, I get the drop option. (image attached)
>>>>>
>>>>> Thom
>>>>>
>>>>
>>>> So did someone accidently tear out some code to make pgAdmin think
>>>> rules can't be dropped?  I'm unable to confirm whether this happens
in
>>>> 1.12.0 beta 1 and 2.  But it doesn't seem to matter whether I'm an
>>>> ordinary user or a superuser.
>>>
>>> Can't see anything obvious. I'm poking around in the debugger now...
>>
>> Works for me with PostgreSQL 9.0 beta 3 and pgAdmin 1.12 beta 3.
>>
>
> That's odd then. What if you use the same DDL as myself:
>
> CREATE TABLE entries
> (
> id serial NOT NULL,
> username text,
> firstname text,
> lastname text,
> signedup timestamp without time zone
> )
> WITH (
> OIDS=FALSE
> );
> ALTER TABLE entries OWNER TO postgres;
>
> CREATE TABLE texts
> (
> title text NOT NULL,
> a_text text,
> CONSTRAINT pk_test_title PRIMARY KEY (title)
> )
> WITH (
> OIDS=FALSE
> );
> ALTER TABLE texts OWNER TO postgres;
>
> CREATE OR REPLACE RULE insert_test AS
> ON INSERT TO entries
> WHERE new.id = 1 DO INSTEAD INSERT INTO texts (title, a_text)
> VALUES ('moo'::text, 'bark'::text);
>
> And this is on Windows XP SP3.
>

Tried it. Still works for me. I'm on Linux, but I don't think it is the
issue :)

--
Guillaume
http://www.postgresql.fr
http://dalibo.com

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2010-07-21 13:32:39 Re: Feature request: drop rules
Previous Message Thom Brown 2010-07-21 13:12:37 Re: Feature request: drop rules