Redundant Database, Pgsql ?

David White dmwhite823 at protonmail.com
Sun Feb 19 17:34:42 UTC 2023


It sounds like you want your application (Dovecot) to gracefully failover.

Take a look at https://www.citusdata.com/blog/2021/02/12/reconnecting-your-app-after-a-postgres-failover/. Perhaps that's what you're looking for, namely, the section on "Multi-Hosts Connection Strings, thanks to libpq"

Someone else on the list could go into the details on this. 



Sent with Proton Mail secure email.

------- Original Message -------
On Sunday, February 19th, 2023 at 10:01 AM, Paul Kudla <paul at scom.ca> wrote:


> I am aware that there are provising for redundant database connections
> 

> Basically i was working on my main db server (which is also a mail sever)
> 

> I current have this in the dovecot-pgsql.conf
> 

> ______________________________________________________________________
> driver = pgsql
> connect = host=localhost port=5433 dbname=scom_billing user=pgsql
> password=xxxxxxxxx
> default_pass_scheme = PLAIN
> 

> password_query = SELECT username as user, password FROM email_users
> WHERE username = '%u' and password <> 'alias' and status = True and
> 

> destination = '%u'
> 

> user_query = SELECT home, uid, gid FROM email_users WHERE username =
> '%u' and password <> 'alias' and status = True and destination = '%u'
> 

> 

> #iterate_query = SELECT user, password FROM email_users WHERE username =
> '%u' and password <> 'alias' and status = True and destination = '%u'
> 

> 

> iterate_query = SELECT "username" as user, domain FROM email_users WHERE
> status = True and alias_flag = False
> 

> _______________________________________________________________________
> 

> Basically I have replicaed servers all over the place but mail18
> (because dovecot only knows of one db instance) went down as well.
> 

> May I please get some guidance on what to add to talk to another
> postgresql server (i have 6 replicated servers so would probably want a
> couple worst case issue)
> 

> 

> 

> --
> 

> 

> Happy Sunday !!!
> Thanks - paul
> 

> Paul Kudla
> 

> 

> Scom.ca Internet Services http://www.scom.ca
> 

> 004-1009 Byron Street South
> Whitby, Ontario - Canada
> L1N 4S3
> 

> Toronto 416.642.7266
> Main 1.866.411.7266
> Fax 1.888.892.7266
> Email paul at scom.ca
-------------- next part --------------
A non-text attachment was scrubbed...
Name: publickey - dmwhite823 at protonmail.com - 0x320CD582.asc
Type: application/pgp-keys
Size: 1739 bytes
Desc: not available
URL: <https://dovecot.org/pipermail/dovecot/attachments/20230219/b66a0034/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 509 bytes
Desc: OpenPGP digital signature
URL: <https://dovecot.org/pipermail/dovecot/attachments/20230219/b66a0034/attachment.sig>


More information about the dovecot mailing list