[QGIS-Developer] postgis connection to server instead of individual databases?
Jorge Gustavo Rocha
jgr at di.uminho.pt
Sat Jan 27 04:03:45 PST 2018
Hi,
Technically, we always need to connect to a database :-)
What we can do is to connect to the 'postgres' database using the user
credentials to query all the available databases, and then use something
like "DECLARE alldbs CURSOR FOR select * from pg_database" to retrieve
the list of available databases.
The user then chooses the database he wants to connect to.
Maybe we need some additional logic/configuration parameters for cases
when there are different roles to access different databases. Roles and
role permissions are the only issue related to this approach.
I think we can change the QGIS logic just by changing the interface.
Regards,
Jorge Gustavo
On 27-01-2018 11:36, Andreas Neumann wrote:
> Hi,
>
> I agree that it would be desirable that all available DBs would be
> listed. As to services: the pg_service.conf file also contains several
> entries, so it would also be possible to list all available service
> configurations.
>
> Just a wish: if we go this route, please, please, don't open all DBs at
> once. Just list the available DBs, let the user choose one of the
> available ones and then open only the DB the user is interested in.
> Otherwise it would be a performance issue. We have DBs with serveral
> hundred tables, sometimes > 1000. If they would be opened all at once,
> it would be really slow.
>
> Andreas
>
> On 27.01.2018 12:19, Paolo Cavallini wrote:
>> Il 27/01/2018 10:05, Raymond Nijssen ha scritto:
>>
>>> It would be very handy if QGIS could remember, for example, my
>>> localhost-postgres:postgres connection and update the available
>>> databases for me.
>>>
>>> Would that be possible? (Or is it but am I doing something wrong here?)
>> agreed, I always wondered why we chose this approach. Of course, to use
>> services we have to ave single connections to individual DBs.
>> All the best.
>>
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
J. Gustavo
--
Jorge Gustavo Rocha
Departamento de Informática
Universidade do Minho
4710-057 Braga
Tel: +351 253604480
Fax: +351 253604471
Móvel: +351 910333888
skype: nabocudnosor
More information about the QGIS-Developer
mailing list