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

Re: A new feature patch and a bug fix

From: Dave Page <dpage(at)postgresql(dot)org>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: A new feature patch and a bug fix
Date: 2007-12-17 16:26:44
Message-ID: 4766A344.5060408@postgresql.org (view raw or flat)
Thread:
Lists: pgadmin-hackers
Guillaume Lelarge wrote:
> Dave Page wrote:
>> Guillaume Lelarge wrote:
>>> 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.
>> No, in 8.1+ it works for roles whether they are what we would call login
>> roles or group roles. In 8.0 and below we had separate users and groups,
>> but I'm not sure you could assign ownership to a group back then.
>>
> 
> You're right. I checked this on a 7.4 (I don't have a 8.0 release
> available) and, with this release, a group can't be the owner of a table.
> 
> Do you think I should raise the issue (group owner on 8.1+) on
> pgsql-hackers ?

No - I think it just works because pg_group is a view over pg_role (or
whatever it's called ) on 8.1. I would try something like:

Index: pgadmin/dlg/dlgProperty.cpp
===================================================================
--- pgadmin/dlg/dlgProperty.cpp	(révision 6910)
+++ pgadmin/dlg/dlgProperty.cpp	(copie de travail)
@@ -432,7 +432,14 @@

 void dlgProperty::AddUsers(ctlComboBoxFix *cb1, ctlComboBoxFix *cb2)
 {
-    FillCombobox(wxT("SELECT usename FROM pg_user ORDER BY usename"),
cb1, cb2);
+	if (connection->BackendMinimumVersion(8, 1))
+	{
+        FillCombobox(wxT("SELECT rolname FROM pg_roles ORDER BY 1"),
cb1, cb2);
+    }
+    else
+    {
+        FillCombobox(wxT("SELECT usename FROM pg_user ORDER BY 1"),
cb1, cb2);
+    }
 }


>>> 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 ?
>> Yes, I don't think it should be two dialogues.
>>
> 
> I'm working on it now.

'K.

/D


In response to

Responses

pgadmin-hackers by date

Next:From: Guillaume LelargeDate: 2007-12-17 16:48:47
Subject: Re: A new feature patch and a bug fix
Previous:From: Guillaume LelargeDate: 2007-12-17 16:22:43
Subject: Re: A new feature patch and a bug fix

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