Re: Check server mode (standby / master)

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Alexander Perepelica <perepelica(dot)alex(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Check server mode (standby / master)
Date: 2011-08-16 13:16:54
Message-ID: CA+U5nMJHWeuH8K1V+YXXBJwYnod8qN++vMtf2PMPTHTCLMETLg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Aug 16, 2011 at 8:46 AM, Alexander Perepelica
<perepelica(dot)alex(at)gmail(dot)com> wrote:

> How can I check which mode has a sever: master or slave (standby) after I
> setup replication?

You can run the query pg_is_in_recovery(), available since 9.0
http://developer.postgresql.org/pgdocs/postgres/functions-admin.html#FUNCTIONS-RECOVERY-INFO-TABLE

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John DeSoi 2011-08-16 13:23:53 Re: [GENERAL] Using Postgresql as application server
Previous Message Lauri Kajan 2011-08-16 13:03:35 Re: join between a table and function.