Re: database aliasing options ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: database aliasing options ?
Дата
Msg-id 1983183.1604936992@sss.pgh.pa.us
обсуждение исходный текст
Ответ на database aliasing options ?  (David Gauthier <davegauthierpg@gmail.com>)
Ответы Re: database aliasing options ?  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Список pgsql-general
David Gauthier <davegauthierpg@gmail.com> writes:
> 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.

Some people do this by changing the DNS entry for the server.

Another thought is that maybe you don't have to do anything dynamic,
if you set up the clients with host lists not just single hostnames
(that is, "-h host1,host2" or the equivalent).  That should work for
any libpq-based client.

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: David Gauthier
Дата:
Сообщение: database aliasing options ?
Следующее
От: mark armon
Дата:
Сообщение: How to set up a schema default date to '2020-01-01'?