pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Lelarge <guillaume@lelarge.info>
To: Shoaib Mir <shoaibmir@gmail.com>
Cc: Rudolf van der Leeden <vanderleeden@logicunited.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: How to find the primary server of a hot standby server?
Date: Fri, 15 Oct 2010 08:27:08 +0200
Message-ID: <4CB7F43C.70303@lelarge.info> (raw)
In-Reply-To: <AANLkTi=xxbhFHn6QxD52kv43_8HfEms_0Of3MvgQcTmn@mail.gmail.com>
References: <0F09A748-DB17-44B3-BCE0-2FEAA22E8FE5@logicunited.com>
	<4CB786B7.7080700@lelarge.info>
	<AANLkTi=xxbhFHn6QxD52kv43_8HfEms_0Of3MvgQcTmn@mail.gmail.com>

Le 15/10/2010 00:53, Shoaib Mir a écrit :
> On Fri, Oct 15, 2010 at 9:39 AM, Guillaume Lelarge
> <guillaume@lelarge.info>wrote:
> 
>> Le 14/10/2010 23:18, Rudolf van der Leeden a écrit :
>>> [...]
>>> quick question to the PG 9 community.
>>>
>>> I can query a hot standby server if recovery is still active using
>>> the administration function pg_is_in_recovery(). Is there also a way
>>> to query for the 'primary server', i.e. which server is delivering
>>> the WAL records?
>>>
>>> I'd like to monitor a bunch of standby servers in terms of
>>> configuration and operation.
>>>
>>
>> There's no "SQL" way to know this, AFAICT. But I would love to be proven
>> wrong: I would be able to add this info to pgAdmin, which would be great.
>>
>>
>>
> What about doing a query like:
> 
> show wal_level;
> 
> If it shows *hot_standby* then that server should have been setup as master.
> As an extra step you can also check for archive_mode as well if its enabled
> or not.
> 

It only helps you to know that the serveur you're currently connected to
is acting as a primary server. It doesn't tell you who the slaves are.
And it doesn't answer the OP's question which is, if I don't get it
wrong, "I'm connected to a slave, how do I know which master it works
with?".


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com



view thread (4+ messages)

Message-ID: <4CB7F43C.70303@lelarge.info>
Permalink:  ../4CB7F43C.70303@lelarge.info/
Also on:    postgresql.org/message-id/4CB7F43C.70303@lelarge.info

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: guillaume@lelarge.info, shoaibmir@gmail.com, vanderleeden@logicunited.com
  Subject: Re: How to find the primary server of a hot standby server?
  In-Reply-To: <4CB7F43C.70303@lelarge.info>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox