database aliasing options ?

From: David Gauthier <davegauthierpg(at)gmail(dot)com>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: database aliasing options ?
Date: 2020-11-09 15:24:04
Message-ID: CAMBRECA2X01tECdC7BaFp35ECc1A1d8weg23HOvh2yQM2Hr9wg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi:

version 11.5 on linux.

Our IT dept has configured our PG DB as a "High Availability" database. It
has a primary and backup server (disks too). Normally both are running but
if one goes down, the other is still available for use, effectively keeping
the DB up while the failed server is being repaired.

My question has to do with creating and using a DB alias for DB connection
code. Of course the idea would be to toggle which server the alias is
pointing to based on the state of the servers. The idea is to manage which
server is being used OUTSIDE of the DB connection code by changing the
alias. The code always uses the alias.

Years ago, working for a different company, they had DB aliases, so I'm
assuming this is still possible (please tell if if it's not !). If this is
possible, where should I point our IT guys as far as instructions on how to
enable this or, if there are multiple options, what are a couple of the
simplest/best? Also, what options are there for the automated toggling of
which server the alias is pointing to if/when the one it's pointing to
comes down ?

Thanks for any replies !

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2020-11-09 15:49:52 Re: database aliasing options ?
Previous Message Tom Lane 2020-11-09 15:10:30 Re: Different result behavior when using ANY(ARRAY(SELECT)) and IN (SELECT)