Skip site navigation (1) Skip section navigation (2)

Re: A new feature patch and a bug fix

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: A new feature patch and a bug fix
Date: 2007-12-17 16:03:45
Message-ID: 47669DE1.4070602@lelarge.info (view raw or flat)
Thread:
Lists: pgadmin-hackers
Dave Page wrote:
> Guillaume Lelarge wrote:
>> Let's begin with the bug fix. I've found that I can set the owner of an
>> object only from login role. pgAdmin doesn't allow me to set ownership
>> to a group. psql allows it, so I think this is a bug. The patch named
>> "dlgProperty.patch" fixes this issue.
> 
> OK... but can you really assign ownership to a group as well as a group
> role? For example, from:
> http://www.postgresql.org/docs/8.0/interactive/sql-altertable.html
> 
> ----
> This form changes the owner of the table, index, sequence, or view to
> the specified user.
> ----
> 
> That implies just users to me.
> 

I did it for a group, works great (8.1 and 8.2). Now, I don't really
know if this is really a feature or something overlooked. Either pgAdmin
is wrong either psql is.

>> I found this when I tried to add "reassign owned by" and "drop owned by"
>> functionalities to pgAdmin. I first thought I would add this with the
>> drop-user code but I prefer to make it available alone. So I used my
>> well known way : a new contextual menu (in fact two : "Reassign Owned
>> To..." and "Drop Owned"). The first one opens a wxSingleChoiceDialog
>> dialog for the user to choose a role from. The second one waits for a
>> confirmation and then fires the SQL statement. My problem is here : on a
>> user contextual menu, the only connection I can get is the maintenance
>> connection. So I will only be able to reassign or drop objects within
>> the maintenance database. I was wondering if there was a way to get a
>> handle to the last open connection ? or if there was another way ? for
>> example asking the user to choose the database to connect to and fire
>> the SQL statement ? or asking the user to select a database where he's
>> already connected to ?
> 
> Yeah, I think that's going to be the only way - present a list of
> databases on the server. Or do it the other way round and add the
> functionality to the database object and present a list of roles to
> choose from.
> 

I'll take a look at the query tool to see how to do this ("present a
list of databases on the server"). Another call to wxSingleChoiceDialod
seems a bad way to me... I'll need to add a new dialog, don't you think ?


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

In response to

Responses

pgadmin-hackers by date

Next:From: Dave PageDate: 2007-12-17 16:07:52
Subject: Re: A new feature patch and a bug fix
Previous:From: Dave PageDate: 2007-12-17 15:52:15
Subject: Re: A new feature patch and a bug fix

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group