From: Emile Amewoto <emileam@yahoo.com>
To: lejeczek <peljasz@yahoo.co.uk>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: tell master to tell it's the master - ?
Date: Fri, 18 Aug 2023 11:34:47 +0200
Message-ID: <6B782D94-E9A9-48D3-829F-0F1DF9585189@yahoo.com> (raw)
In-Reply-To: <3e072d55-a260-d4aa-0ea7-0ce395e359eb@yahoo.co.uk>
References: <3e072d55-a260-d4aa-0ea7-0ce395e359eb.ref@yahoo.co.uk>
<3e072d55-a260-d4aa-0ea7-0ce395e359eb@yahoo.co.uk>
Hi Lejeczek,
What are you using to control your cluster?
If you are using patroni, you can use regex to grep the Leader or if you are not using any cluster manager you can do:
SELECT Count(pid))
FROM pg_stat_activity WHERE wait_event IS NOT NULL AND backend_type = ‘walsender'
The master will always have walsender process and the standby walreiver
Regards,
Emile
> On 18 Aug 2023, at 11:07, lejeczek <peljasz@yahoo.co.uk> wrote:
>
> Hi guys.
>
> Is it possible to configure pgSQL to announce it's being a master and not querying it?
> I was hoping for a file whose existence or content would confirm that and would be generated/created by pqSQL itself - am I too naive?
>
> many thanks, L.
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: emileam@yahoo.com, peljasz@yahoo.co.uk, pgsql-admin@lists.postgresql.org
Subject: Re: tell master to tell it's the master - ?
In-Reply-To: <6B782D94-E9A9-48D3-829F-0F1DF9585189@yahoo.com>
* 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