[QGIS-Developer] PostgreSQL connection - more than one DB host

Tim Sutton tim at kartoza.com
Wed May 22 12:00:04 PDT 2019


Hi

We have another use case that I wonder if anyone has thought about or done any work towards?:

In Django you have this ability to route requests to a specific connection. So for example you can pull read requests off one database instance and push write requests to another.

Something similar in QGIS would be hugely useful - we often have bandwidth impoverished users and we set up a postgres read only replica for them. It would be really nice to support writes across their slow internet connection and reads from their fast local internet. Otherwise maybe this is something that could be solved with creative use of triggers / FDW’s / materialised views….

Regards

Tim


> On 21 May 2019, at 12:51, Régis Haubourg <regis.haubourg at gmail.com> wrote:
> 
> Interesting, if this works, that could be awesome for having one project for multiple working sites or on the field use cases. (I just discover it is now possible to run postgresql on Android last week)
> Régis
> 
> Le mar. 21 mai 2019 à 13:02, Tim Sutton <tim at kartoza.com <mailto:tim at kartoza.com>> a écrit :
> Did you try it using a service file (haven’t tested myself)….would be interesting to hear how you got it working….
> 
> Regards
> 
> Tim
> 
>> On 21 May 2019, at 08:47, Andreas Neumann <a.neumann at carto.net <mailto:a.neumann at carto.net>> wrote:
>> 
>> Hi,
>> 
>> According to the libpq documentation it is possible to specify more than one host for PG connections.
>> 
>> See https://www.postgresql.org/docs/current/libpq-connect.html <https://www.postgresql.org/docs/current/libpq-connect.html>  --> section 34.1.1.2. Connection URIs
>> 
>> -----------
>> 
>> It is possible to specify multiple host components, each with an optional port component, in a single URI. A URI of the form postgresql://host1:port1,host2:port2,host3:port3/ <> is equivalent to a connection string of the form host=host1,host2,host3 port=port1,port2,port3. Each host will be tried in turn until a connection is successfully established.
>> 
>> -------------
>> 
>> Is this option to specify more than one host supported by QGIS and if yes, how? It would only make sense for read-only connections, I think.
>> 
>> Thanks,
>> Andreas
>> 
>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org <mailto:QGIS-Developer at lists.osgeo.org>
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer <https://lists.osgeo.org/mailman/listinfo/qgis-developer>
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer <https://lists.osgeo.org/mailman/listinfo/qgis-developer>
>> 
> 
> <KartozaNewLogoThumbnail.jpg>
> 
> 
> 
> 
> 
> 
> Tim Sutton
> 
> Co-founder: Kartoza
> Ex Project chair: QGIS.org <http://qgis.org/>
> 
> Visit http://kartoza.com <http://kartoza.com/> to find out about open source:
> 
> Desktop GIS programming services
> Geospatial web development
> GIS Training
> Consulting Services
> 
> Skype: timlinux 
> IRC: timlinux on #qgis at freenode.net <http://freenode.net/>
> 
> I'd love to connect. Here's my calendar link <https://calendly.com/timlinux> to make finding time easy.
> 
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org <mailto:QGIS-Developer at lists.osgeo.org>
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer <https://lists.osgeo.org/mailman/listinfo/qgis-developer>
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer <https://lists.osgeo.org/mailman/listinfo/qgis-developer>
—









Tim Sutton

Co-founder: Kartoza
Ex Project chair: QGIS.org

Visit http://kartoza.com <http://kartoza.com/> to find out about open source:

Desktop GIS programming services
Geospatial web development
GIS Training
Consulting Services

Skype: timlinux 
IRC: timlinux on #qgis at freenode.net

I'd love to connect. Here's my calendar link <https://calendly.com/timlinux> to make finding time easy.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190522/d7719b2a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KartozaNewLogoThumbnail.jpg
Type: image/jpeg
Size: 6122 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190522/d7719b2a/attachment-0001.jpg>


More information about the QGIS-Developer mailing list