Re: Patch: Implement failover on libpq connect level. - Mailing list pgsql-hackers

From Tsunakawa, Takayuki
Subject Re: Patch: Implement failover on libpq connect level.
Date
Msg-id 0A3221C70F24FB45833433255569204D1F641367@G01JPEXMBYT05
Whole thread Raw
In response to Re: Patch: Implement failover on libpq connect level.  (Tatsuo Ishii <ishii@sraoss.co.jp>)
List 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 by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Document how to set up TAP tests for Perl 5.8.8
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Document how to set up TAP tests for Perl 5.8.8