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 <p...@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 p...@scom.ca

Attachment: publickey - dmwhite823@protonmail.com - 0x320CD582.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to