[pgpool-general: 9402] Re: Question about backend_application_name

Ron Johnson ronljohnsonjr at gmail.com
Thu Mar 27 09:20:48 JST 2025


On Wed, Mar 26, 2025 at 7:56 PM Tatsuo Ishii <ishii at postgresql.org> wrote:

> > PgPool 4.5.4
> >
> > Three node pgpool cluster:
> > Node0 = Postgresql primary
> > Node1 = Postgresql streaming replica
> > Node2 = PgPool leader, where the VIP sits.
> >
> >
> https://www.pgpool.net/docs/45/en/html/runtime-config-backend-settings.html
> >
> > The docs consistently refer to setting backend_application_nameX to
> > "serverX", so that's what I did:
>
> "serverX" is just an example. You can use arbitrary name for
> backend_application_nameX as long as:
>
> a) It matches with the application name set in the primary_conninfo in
> postgresql.conf.
>

On the replica (aka Node 1), there is no primary_coninfo in either
postgresql.conf or postgresql.auto.conf.

pg_stat_wal_receiver.conninfo has this section:
fallback_application_name="walreceiver".

(I initiate replication using "pg_basebackup --wal-method=stream
--create-slot --slot=foo.)


>
> b) No same application names are used in all primary_conninfo.
>
> > But should it really be set to "walreceiver"?  Should both
> > backend_application_name0 and backend_application_name1 be set to
> > "walreceiver" even though it's only running on Node1?
>
> I never tried it but probably yes. However I recommend in general to
> set unique application names for each
> backend_application_nameX. Someday you might want to add more replica.
>

How does the second replica know to set it's name different from the first?


>
> > cdsmultip=# pgpool show backend_application_name2;
> >  backend_application_name2
> > ---------------------------
> >
> > (1 row)
>
> What's this? You said you only have one replica.
>
>
You can successfully run "pgpool show backend_application_name2;" even
though only _name0 and _name1 are defined in pgpool.conf.

I ran the command just for completeness.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20250326/b078016c/attachment.htm>


More information about the pgpool-general mailing list