Обсуждение: Server order
<br /><font face="sans-serif" size="2">Is there a way to change the order of the servers in the Servers list? It'd be niceif they were alphabetically sorted.</font>
Unfortunately, it is currently not that easy because that information is stored in the Windows registry.
I think it would be a nice enhancement if it were stored in a small local PostgreSQL database table,
(suggestion - PgAdminDB), but I guess that is something that may be considered for a future enhancement.
From: pgadmin-support-owner@postgresql.org [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of Mike.Blackwell@rrd.com
Sent: Tuesday, May 22, 2007 2:05 PM
To: pgadmin-support@postgresql.org
Subject: [pgadmin-support] Server order
Sent: Tuesday, May 22, 2007 2:05 PM
To: pgadmin-support@postgresql.org
Subject: [pgadmin-support] Server order
Is there a way to change the order of the servers in the Servers list? It'd be nice if they were alphabetically sorted.
Melvin Davidson wrote: > Unfortunately, it is currently not that easy because that information is > stored in the Windows registry. > > I think it would be a nice enhancement if it were stored in a small > local PostgreSQL database table, > (suggestion - PgAdminDB), but I guess that is something that may be > considered for a future enhancement. Which would make you to have locally installed postgres if you want to use PgAdmin? Please, don't do so! :) A file in user's home directory, .pgadmin or something should be sufficient. Mike
Hmmm! I agree with you. It would make absolutely no sense to have a PostgreSQL database when you just need to administer them? -----Original Message----- From: pgadmin-support-owner@postgresql.org [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of Mario Splivalo Sent: Tuesday, May 22, 2007 3:09 PM To: pgadmin-support@postgresql.org Subject: Re: [pgadmin-support] Server order Melvin Davidson wrote: > Unfortunately, it is currently not that easy because that information > is stored in the Windows registry. > > I think it would be a nice enhancement if it were stored in a small > local PostgreSQL database table, (suggestion - PgAdminDB), but I guess > that is something that may be considered for a future enhancement. Which would make you to have locally installed postgres if you want to use PgAdmin? Please, don't do so! :) A file in user's home directory, .pgadmin or something should be sufficient. Mike ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster
From: pgadmin-support-owner@postgresql.org [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of Melvin Davidson
Sent: dinsdag 22 mei 2007 22:30
To: Mike.Blackwell@rrd.com; pgadmin-support@postgresql.org
Subject: Re: [pgadmin-support] Server orderUnfortunately, it is currently not that easy because that information is stored in the Windows registry.
No for comment, but I cannot imagine how the display order is so directly related to the registry. Generally sorting before displaying doesn't seem to be such a complicated feature.
Most likely you are meaning that you are using the position in the list to reference information in the registry. Can't this be solved by a simple lookup table translating display-order to storage-order?
- Joris Dobbelsteen
On Tue, 22 May 2007 15:45:58 -0600, Melvin Davidson wrote: > Hmmm! I agree with you. It would make absolutely no sense to have a > PostgreSQL database when you just need to administer them? > You are not really expected to _always_ have the DB server on the same machine the pgAdmin runs. Having the whole DB server only to store (other?) DB server connection configurations would be a big overshoot, IMHO. -- Leszek
On Tue, 22 May 2007 15:45:58 -0600, Melvin Davidson wrote: > Hmmm! I agree with you. It would make absolutely no sense to have a > PostgreSQL database when you just need to administer them? > You are not really expected to _always_ have the DB server on the same machine the pgAdmin runs. Having the whole DB server only to store (other?) DB server connection configurations would be a big overshoot, IMHO. -- Leszek
Mike.Blackwell@rrd.com a écrit : > > Is there a way to change the order of the servers in the Servers list? > It'd be nice if they were alphabetically sorted. The patch attached sorts them alphabetically. As it changes the behavior, perhaps an option is needed to enable it. Dave, what do you think about it ? Regards. -- Guillaume. <!-- http://abs.traduc.org/ http://lfs.traduc.org/ http://docs.postgresqlfr.org/ --> Index: pgadmin/schema/pgServer.cpp =================================================================== --- pgadmin/schema/pgServer.cpp (révision 6319) +++ pgadmin/schema/pgServer.cpp (copie de travail) @@ -1063,6 +1063,7 @@ server->iSetDbRestriction(dbRestriction); server->iSetServerIndex(loop); browser->AppendItem(obj->GetId(), server->GetFullName(), server->GetIconId(), -1, server); + browser->SortChildren(obj->GetId()); #ifdef WIN32 @@ -1112,6 +1113,7 @@ server->iSetDiscovered(true); server->iSetServiceID(svcName); browser->AppendItem(obj->GetId(), server->GetFullName(), server->GetIconId(), -1, server); + browser->SortChildren(obj->GetId()); } // Get the next one... flag = pgKey->GetNextKey(svcName, cookie); @@ -1197,6 +1199,7 @@ wxLogInfo(wxT("pgServer object initialised as required.")); browser->AppendItem(form->GetServerCollection()->GetId(), server->GetFullName(), icon, -1, server); + browser->SortChildren(form->GetServerCollection()->GetId()); browser->Expand(form->GetServerCollection()->GetId()); wxString label;
Guillaume Lelarge wrote: > Mike.Blackwell@rrd.com a écrit : >> >> Is there a way to change the order of the servers in the Servers list? >> It'd be nice if they were alphabetically sorted. > > The patch attached sorts them alphabetically. As it changes the > behavior, perhaps an option is needed to enable it. Dave, what do you > think about it ? I'm in a lecture atm, so can't check that thoroughly, but I think you missed an AppendItem() call site further up in pgServerFactory::CreateObjects (you only got the one where pgInstaller installations are auto-added. Otherwise, please commit. BTW; did you fix that SQL formatting error that Erwin reported? /D
Dave Page a écrit : > Guillaume Lelarge wrote: >> Mike.Blackwell@rrd.com a écrit : >>> Is there a way to change the order of the servers in the Servers list? >>> It'd be nice if they were alphabetically sorted. >> The patch attached sorts them alphabetically. As it changes the >> behavior, perhaps an option is needed to enable it. Dave, what do you >> think about it ? > > I'm in a lecture atm, so can't check that thoroughly, but I think you > missed an AppendItem() call site further up in > pgServerFactory::CreateObjects (you only got the one where pgInstaller > installations are auto-added. > I've got three of them : - start of pgAdmin, CreateObjects adds the already registered servers ; - after that, still in CreateObjets,pgAdmin tries to find PostgreSQL services on win32 servers ; - when a user registers a new server, it calls StartDialog. I don't find more of browser->AppendItem. There are a few other AppendItem but for the properties variable. I've seen another browser->AppendItem on dlgProperty.cpp but it does not seem to update the server list, doesn't it ? > Otherwise, please commit. > I didn't commit it yet because of the AppendItem missed that I can't find. > BTW; did you fix that SQL formatting error that Erwin reported? > No, I'll take care of this tomorrow. Regards. -- Guillaume. <!-- http://abs.traduc.org/ http://lfs.traduc.org/ http://docs.postgresqlfr.org/ -->
>-----Original Message----- >From: pgadmin-support-owner@postgresql.org >[mailto:pgadmin-support-owner@postgresql.org] On Behalf Of >Guillaume Lelarge >Sent: woensdag 23 mei 2007 18:58 >To: Mike.Blackwell@rrd.com >Cc: pgadmin-support@postgresql.org >Subject: Re: [pgadmin-support] Server order > >Mike.Blackwell@rrd.com a écrit : >> >> Is there a way to change the order of the servers in the >Servers list? >> It'd be nice if they were alphabetically sorted. > >The patch attached sorts them alphabetically. As it changes >the behavior, perhaps an option is needed to enable it. Dave, >what do you think about it ? Imho an option is not needed, instead it makes the tree/behaviour more consistent. All other user named elements are alreadyin sorted order (take tablespaces, tables, views, functions, roles, ...). This just completes it (more). - Joris Dobbelsteen
Guillaume Lelarge wrote: > Dave Page a écrit : >> Guillaume Lelarge wrote: >>> Mike.Blackwell@rrd.com a écrit : >>>> Is there a way to change the order of the servers in the Servers list? >>>> It'd be nice if they were alphabetically sorted. >>> The patch attached sorts them alphabetically. As it changes the >>> behavior, perhaps an option is needed to enable it. Dave, what do you >>> think about it ? >> >> I'm in a lecture atm, so can't check that thoroughly, but I think you >> missed an AppendItem() call site further up in >> pgServerFactory::CreateObjects (you only got the one where pgInstaller >> installations are auto-added. >> > > I've got three of them : > - start of pgAdmin, CreateObjects adds the already registered servers ; > - after that, still in CreateObjets, pgAdmin tries to find PostgreSQL > services on win32 servers ; > - when a user registers a new server, it calls StartDialog. > > I don't find more of browser->AppendItem. There are a few other > AppendItem but for the properties variable. > > I've seen another browser->AppendItem on dlgProperty.cpp but it does not > seem to update the server list, doesn't it ? > >> Otherwise, please commit. >> > > I didn't commit it yet because of the AppendItem missed that I can't find. Sorry, my fault - I misread the patch. Told you I couldn't check thoroughly :-p >> BTW; did you fix that SQL formatting error that Erwin reported? >> > > No, I'll take care of this tomorrow. Thanks, Dave
Dave Page a écrit : > [...] > BTW; did you fix that SQL formatting error that Erwin reported? > Here is the patch that fixes it. Regards. -- Guillaume. <!-- http://abs.traduc.org/ http://lfs.traduc.org/ http://docs.postgresqlfr.org/ --> Index: pgadmin/schema/pgTable.cpp =================================================================== --- pgadmin/schema/pgTable.cpp (révision 6321) +++ pgadmin/schema/pgTable.cpp (copie de travail) @@ -248,32 +248,32 @@ if (!prevComment.IsEmpty()) sql += wxT(" -- ") + firstLineOnly(prevComment); - sql += wxT("\n)\n"); + sql += wxT("\n)"); if (GetInheritedTableCount()) { - sql += wxT("INHERITS (") + GetQuotedInheritedTables() + wxT(")\n"); + sql += wxT("\nINHERITS (") + GetQuotedInheritedTables() + wxT(")"); } if (GetConnection()->BackendMinimumVersion(8, 2)) { - sql += wxT("WITH ("); + sql += wxT("\nWITH ("); if (GetFillFactor().Length() > 0) sql += wxT("FILLFACTOR=") + GetFillFactor() + wxT(", "); if (GetHasOids()) sql += wxT("OIDS=TRUE"); else sql += wxT("OIDS=FALSE"); - sql += wxT(")\n"); + sql += wxT(")"); } else { if (GetHasOids()) - sql += wxT("WITH OIDS\n"); + sql += wxT("\nWITH OIDS"); else - sql += wxT("WITHOUT OIDS\n"); + sql += wxT("\nWITHOUT OIDS"); } - AppendIfFilled(sql, wxT(" TABLESPACE "), qtIdent(tablespace)); + AppendIfFilled(sql, wxT("\nTABLESPACE "), qtIdent(tablespace)); sql += wxT(";\n") + GetOwnerSql(7, 3);
Guillaume Lelarge wrote: > Dave Page a écrit : >> [...] >> BTW; did you fix that SQL formatting error that Erwin reported? >> > > Here is the patch that fixes it. Please feel free to commit trivial fixes such as this without asking first - we can always rollback or fix if a problem is found later. Regards, Dave