pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios - cloud <a.mantzios@cloud.gatewaynet.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: postgresql custom variable in pg_settings table
Date: Tue, 9 Jan 2024 10:18:10 +0200
Message-ID: <1e556c27-dfc2-30be-ff10-851645cae2a2@cloud.gatewaynet.com> (raw)
In-Reply-To: <CABWY_HCPQ6c65aBPHSHMXg43SACBxWOd9Vq8Wyut7hGy6Y1qHw@mail.gmail.com>
References: <CABWY_HCPQ6c65aBPHSHMXg43SACBxWOd9Vq8Wyut7hGy6Y1qHw@mail.gmail.com>

On 1/9/24 09:38, Yi Sun wrote:

> Hello,
>
> We custom set variable
>
> Added patroni.nodes_count = 2 in postgresql.conf
>
> postgres=# show patroni.nodes_count;
>  patroni.nodes_count
> ---------------------
>  2
> (1 row)
>
> postgres=# select current_setting('patroni.nodes_count');
>  current_setting
> -----------------
>  2
> (1 row)
>
> But can not select it from pg_settings, as we use pgwatch2 to monitor, 
> to avoid pgwatch2 script change prefer to use pg_setting not 
> current_setting() function, is it possible to get the custom variable 
> from pg_setting please? Thanks

You may look into pg_file_settings :

select setting from pg_file_settings  where name = 'patroni.nodes_count';

>
> Best Regards
> SY

view thread (3+ messages)  latest in thread

Message-ID: <1e556c27-dfc2-30be-ff10-851645cae2a2@cloud.gatewaynet.com>
Permalink:  ../1e556c27-dfc2-30be-ff10-851645cae2a2@cloud.gatewaynet.com/
Also on:    postgresql.org/message-id/1e556c27-dfc2-30be-ff10-851645cae2a2@cloud.gatewaynet.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: a.mantzios@cloud.gatewaynet.com
  Subject: Re: postgresql custom variable in pg_settings table
  In-Reply-To: <1e556c27-dfc2-30be-ff10-851645cae2a2@cloud.gatewaynet.com>
  References: <CABWY_HCPQ6c65aBPHSHMXg43SACBxWOd9Vq8Wyut7hGy6Y1qHw@mail.gmail.com> <1e556c27-dfc2-30be-ff10-851645cae2a2@cloud.gatewaynet.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