Re: Patch: Implement failover on libpq connect level.

Поиск
Список
Период
Сортировка
От Tsunakawa, Takayuki
Тема Re: Patch: Implement failover on libpq connect level.
Дата
Msg-id 0A3221C70F24FB45833433255569204D1F641367@G01JPEXMBYT05
обсуждение исходный текст
Ответ на Re: Patch: Implement failover on libpq connect level.  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Список pgsql-hackers
From: pgsql-hackers-owner@postgresql.org
> [mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Tatsuo Ishii
> In my understanding pg_is_in_recovery() returns true if it's a standby node.
> However, even if it returns other than true, the server is not necessarily
> a primary. Even it's not configured as a streaming replication primary,
> it returns other than true.
> 
> So if your intention is finding a primary, I am not sure if
> pg_is_in_recovery() is the best solution.

Yes, I don't think pg_is_in_recovery() is the best, but there doesn't seem to be a better solution.
pg_is_in_recovery(),as its name clearly suggests, returns true if the server is performing recovery.  For example, it
returnstrue if hot_standby=on is present in postgresql.conf and the recovery from backup is in progress.  It's not a
standby.

Regards
Takayuki Tsunakawa




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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Document how to set up TAP tests for Perl 5.8.8
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Document how to set up TAP tests for Perl 5.8.8