Thread: Feature request: drop rules

Feature request: drop rules

From
Thom Brown
Date:
I noticed you can't drop rules from the GUI.  Could this be added?

Thanks

Thom

Re: Feature request: drop rules

From
Guillaume Lelarge
Date:
On Wed, 21 Jul 2010 09:43:33 +0100, Thom Brown <thombrown@gmail.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.

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

Re: Feature request: drop rules

From
Dave Page
Date:
On Wed, Jul 21, 2010 at 10:03 AM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> On Wed, 21 Jul 2010 09:43:33 +0100, Thom Brown <thombrown@gmail.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.

That's what I thought, but I tried it and I can't - the option just
isn't offered.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: Feature request: drop rules

From
Thom Brown
Date:
On 21 July 2010 10:03, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> On Wed, 21 Jul 2010 09:43:33 +0100, Thom Brown <thombrown@gmail.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)

Thom

Attachment

Re: Feature request: drop rules

From
Guillaume Lelarge
Date:
On Wed, 21 Jul 2010 10:23:33 +0100, Thom Brown <thombrown@gmail.com>
wrote:
> On 21 July 2010 10:03, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>> On Wed, 21 Jul 2010 09:43:33 +0100, Thom Brown <thombrown@gmail.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?


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

Re: Feature request: drop rules

From
Thom Brown
Date:
On 21 July 2010 10:38, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> On Wed, 21 Jul 2010 10:23:33 +0100, Thom Brown <thombrown@gmail.com>
> wrote:
>> On 21 July 2010 10:03, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>> On Wed, 21 Jul 2010 09:43:33 +0100, Thom Brown <thombrown@gmail.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

Attachment

Re: Feature request: drop rules

From
Thom Brown
Date:
On 21 July 2010 10:45, Thom Brown <thombrown@gmail.com> wrote:
> On 21 July 2010 10:38, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>> On Wed, 21 Jul 2010 10:23:33 +0100, Thom Brown <thombrown@gmail.com>
>> wrote:
>>> On 21 July 2010 10:03, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>>> On Wed, 21 Jul 2010 09:43:33 +0100, Thom Brown <thombrown@gmail.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.

Thom

Re: Feature request: drop rules

From
Dave Page
Date:
On Wed, Jul 21, 2010 at 2:01 PM, Thom Brown <thombrown@gmail.com> wrote:
> On 21 July 2010 10:45, Thom Brown <thombrown@gmail.com> wrote:
>> On 21 July 2010 10:38, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>> On Wed, 21 Jul 2010 10:23:33 +0100, Thom Brown <thombrown@gmail.com>
>>> wrote:
>>>> On 21 July 2010 10:03, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>>>> On Wed, 21 Jul 2010 09:43:33 +0100, Thom Brown <thombrown@gmail.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...

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: Feature request: drop rules

From
Guillaume Lelarge
Date:
On Wed, 21 Jul 2010 14:04:09 +0100, Dave Page <dpage@pgadmin.org> wrote:
> On Wed, Jul 21, 2010 at 2:01 PM, Thom Brown <thombrown@gmail.com> wrote:
>> On 21 July 2010 10:45, Thom Brown <thombrown@gmail.com> wrote:
>>> On 21 July 2010 10:38, Guillaume Lelarge <guillaume@lelarge.info>
wrote:
>>>> On Wed, 21 Jul 2010 10:23:33 +0100, Thom Brown <thombrown@gmail.com>
>>>> wrote:
>>>>> On 21 July 2010 10:03, Guillaume Lelarge <guillaume@lelarge.info>
>>>>> wrote:
>>>>>> On Wed, 21 Jul 2010 09:43:33 +0100, Thom Brown
<thombrown@gmail.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.


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

Re: Feature request: drop rules

From
Dave Page
Date:
On Wed, Jul 21, 2010 at 2:06 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> Works for me with PostgreSQL 9.0 beta 3 and pgAdmin 1.12 beta 3.

I can reproduce on Windows with trunk + pg84 and Mac with 9.0b3/1.12b3



--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: Feature request: drop rules

From
Thom Brown
Date:
On 21 July 2010 14:06, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> On Wed, 21 Jul 2010 14:04:09 +0100, Dave Page <dpage@pgadmin.org> wrote:
>> On Wed, Jul 21, 2010 at 2:01 PM, Thom Brown <thombrown@gmail.com> wrote:
>>> On 21 July 2010 10:45, Thom Brown <thombrown@gmail.com> wrote:
>>>> On 21 July 2010 10:38, Guillaume Lelarge <guillaume@lelarge.info>
> wrote:
>>>>> On Wed, 21 Jul 2010 10:23:33 +0100, Thom Brown <thombrown@gmail.com>
>>>>> wrote:
>>>>>> On 21 July 2010 10:03, Guillaume Lelarge <guillaume@lelarge.info>
>>>>>> wrote:
>>>>>>> On Wed, 21 Jul 2010 09:43:33 +0100, Thom Brown
> <thombrown@gmail.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.

Thom

Re: Feature request: drop rules

From
Guillaume Lelarge
Date:
On Wed, 21 Jul 2010 14:12:37 +0100, Thom Brown <thombrown@gmail.com>
wrote:
> On 21 July 2010 14:06, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>> On Wed, 21 Jul 2010 14:04:09 +0100, Dave Page <dpage@pgadmin.org>
wrote:
>>> On Wed, Jul 21, 2010 at 2:01 PM, Thom Brown <thombrown@gmail.com>
wrote:
>>>> On 21 July 2010 10:45, Thom Brown <thombrown@gmail.com> wrote:
>>>>> On 21 July 2010 10:38, Guillaume Lelarge <guillaume@lelarge.info>
>> wrote:
>>>>>> On Wed, 21 Jul 2010 10:23:33 +0100, Thom Brown
<thombrown@gmail.com>
>>>>>> wrote:
>>>>>>> On 21 July 2010 10:03, Guillaume Lelarge <guillaume@lelarge.info>
>>>>>>> wrote:
>>>>>>>> On Wed, 21 Jul 2010 09:43:33 +0100, Thom Brown
>> <thombrown@gmail.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

Re: Feature request: drop rules

From
Dave Page
Date:
On Wed, Jul 21, 2010 at 2:26 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
>
> Tried it. Still works for me. I'm on Linux, but I don't think it is the
> issue :)

Actually, it might be. pgRule::CanDrop() is calling schema->CanDrop(),
however schema actually contains the table object. I think this is
because rules can exist under tables and views, so originally deriving
them from pgTableObject seemed wrong.


--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: Feature request: drop rules

From
Thom Brown
Date:
On 21 July 2010 14:32, Dave Page <dpage@pgadmin.org> wrote:
> On Wed, Jul 21, 2010 at 2:26 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>>
>> Tried it. Still works for me. I'm on Linux, but I don't think it is the
>> issue :)
>
> Actually, it might be. pgRule::CanDrop() is calling schema->CanDrop(),
> however schema actually contains the table object. I think this is
> because rules can exist under tables and views, so originally deriving
> them from pgTableObject seemed wrong.
>
>
> --

I create a rule on a view, it comes up with the "Drop/Delete" and
"Drop Cascaded" options.

Thom

Re: Feature request: drop rules

From
Dave Page
Date:
On Wed, Jul 21, 2010 at 2:44 PM, Thom Brown <thombrown@gmail.com> wrote:
> On 21 July 2010 14:32, Dave Page <dpage@pgadmin.org> wrote:
>> On Wed, Jul 21, 2010 at 2:26 PM, Guillaume Lelarge
>> <guillaume@lelarge.info> wrote:
>>>
>>> Tried it. Still works for me. I'm on Linux, but I don't think it is the
>>> issue :)
>>
>> Actually, it might be. pgRule::CanDrop() is calling schema->CanDrop(),
>> however schema actually contains the table object. I think this is
>> because rules can exist under tables and views, so originally deriving
>> them from pgTableObject seemed wrong.
>>
>>
>> --
>
> I create a rule on a view, it comes up with the "Drop/Delete" and
> "Drop Cascaded" options.

I've pushed a commit that should fix this (as well as some icon
improvements that I previously forgot to push). You now get the option
to drop a rule from a table or view (though not if it's "the" rule
that implements the view), and no longer get the option to create
rules on system views.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: Feature request: drop rules

From
Thom Brown
Date:
On 21 July 2010 15:46, Dave Page <dpage@pgadmin.org> wrote:
> On Wed, Jul 21, 2010 at 2:44 PM, Thom Brown <thombrown@gmail.com> wrote:
>> On 21 July 2010 14:32, Dave Page <dpage@pgadmin.org> wrote:
>>> On Wed, Jul 21, 2010 at 2:26 PM, Guillaume Lelarge
>>> <guillaume@lelarge.info> wrote:
>>>>
>>>> Tried it. Still works for me. I'm on Linux, but I don't think it is the
>>>> issue :)
>>>
>>> Actually, it might be. pgRule::CanDrop() is calling schema->CanDrop(),
>>> however schema actually contains the table object. I think this is
>>> because rules can exist under tables and views, so originally deriving
>>> them from pgTableObject seemed wrong.
>>>
>>>
>>> --
>>
>> I create a rule on a view, it comes up with the "Drop/Delete" and
>> "Drop Cascaded" options.
>
> I've pushed a commit that should fix this (as well as some icon
> improvements that I previously forgot to push). You now get the option
> to drop a rule from a table or view (though not if it's "the" rule
> that implements the view), and no longer get the option to create
> rules on system views.
>

Cheers Dave :)  Shame I never actually use rules myself, but I'm sure
many do. ;)

Thom

Re: Feature request: drop rules

From
Thom Brown
Date:
On 21 July 2010 16:01, Thom Brown <thombrown@gmail.com> wrote:
> On 21 July 2010 15:46, Dave Page <dpage@pgadmin.org> wrote:
>> On Wed, Jul 21, 2010 at 2:44 PM, Thom Brown <thombrown@gmail.com> wrote:
>>> On 21 July 2010 14:32, Dave Page <dpage@pgadmin.org> wrote:
>>>> On Wed, Jul 21, 2010 at 2:26 PM, Guillaume Lelarge
>>>> <guillaume@lelarge.info> wrote:
>>>>>
>>>>> Tried it. Still works for me. I'm on Linux, but I don't think it is the
>>>>> issue :)
>>>>
>>>> Actually, it might be. pgRule::CanDrop() is calling schema->CanDrop(),
>>>> however schema actually contains the table object. I think this is
>>>> because rules can exist under tables and views, so originally deriving
>>>> them from pgTableObject seemed wrong.
>>>>
>>>>
>>>> --
>>>
>>> I create a rule on a view, it comes up with the "Drop/Delete" and
>>> "Drop Cascaded" options.
>>
>> I've pushed a commit that should fix this (as well as some icon
>> improvements that I previously forgot to push). You now get the option
>> to drop a rule from a table or view (though not if it's "the" rule
>> that implements the view), and no longer get the option to create
>> rules on system views.
>>
>
> Cheers Dave :)  Shame I never actually use rules myself, but I'm sure
> many do. ;)
>
> Thom
>

Is the reason I can no longer spy on commits via mailing list as they
occur related to the migration to git?

Thom

Re: Feature request: drop rules

From
Dave Page
Date:
On Wed, Jul 21, 2010 at 4:23 PM, Thom Brown <thombrown@gmail.com> wrote:
> Is the reason I can no longer spy on commits via mailing list as they
> occur related to the migration to git?

Yes. Magnus is still finishing off the commit hook that'll deal with
that. I'm trying to find cycles to help him test it....

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: Feature request: drop rules

From
Guillaume Lelarge
Date:
Le 21/07/2010 17:33, Dave Page a écrit :
> On Wed, Jul 21, 2010 at 4:23 PM, Thom Brown <thombrown@gmail.com> wrote:
>> Is the reason I can no longer spy on commits via mailing list as they
>> occur related to the migration to git?
>
> Yes. Magnus is still finishing off the commit hook that'll deal with
> that. I'm trying to find cycles to help him test it....
>

Or you spy via the RSS feed :
http://git.postgresql.org/gitweb?p=pgadmin3.git;a=summary


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