Re: Alerting on memory use and instance crash

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Alerting on memory use and instance crash
Date: 2025-10-08 16:21:53
Message-ID: CANzqJaAmKGtWFwEsLV9NQZhW8+Ud3x97mvPub5PmFfnV1JraKg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 8, 2025 at 11:42 AM sud <suds1434(at)gmail(dot)com> wrote:

> Hi Experts,
>
> It's postgres version 16. I have two questions on alerting as below.
>
> 1)If we want to have alerting on any node/instance that gets crashed :- In
> other databases like Oracle the catalog Views like "GV$Instance" used to
> give information on whether the instances are currently active/down or not.
> But in postgres it seems all the pg_* views are instance specific and are
> not showing information on the global/cluster level but are restricted to
> instance level only. So is there any other way to query the pg_* views to
> have alerts on the specific instance crash?
>

In Postgresql, cluster == instance. That's a historical fluke which might
never go away. Thus, if the cluster is down, you can't access anything.

Connection poolers that use virtual IP addresses and are the modern
definition of "cluster" sit on top of individual PG clusters. Even though
the pooler auto-fails the (modern) cluster to the replica instance, PG
still thinks one cluster is down, and the former-replica cluster is now the
primary cluster.

Confusing? Yes. Just accept that *PG cluster == instance*, and that
*Postgresql
is not Oracle*.

> 2)Is there a way to fetch the data from pg_* view to highlight the
> specific connection/session/sqls which is using high memory in postgres?
>

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2025-10-08 16:22:27 Re: Alerting on memory use and instance crash
Previous Message sud 2025-10-08 15:42:05 Alerting on memory use and instance crash