Application name for pg_basebackup and friends

Started by Jesper Pedersenalmost 7 years ago5 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t41449
psql -h localhost -U postgres

Built from patchset v1 (message #1), July 28, 2026 at 03:37 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t41449_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t41449_1 && git checkout t41449_1

Patchset v1 (message #1) is on t41449_1

Jump to latest
#1Jesper Pedersen
jesper.pedersen@redhat.com

Hi,

The attached patch adds an -a / --appname command line switch to
pg_basebackup, pg_receivewal and pg_recvlogical.

This is useful when f.ex. pg_receivewal needs to connect as a
synchronous client (synchronous_standby_names),

pg_receivewal -h myhost -p 5432 -S replica1 -a replica1 --synchronous
-D /wal

I'll add the patch to the CommitFest for discussion, as there is overlap
with the -d switch.

Best regards,
Jesper

Attachments:

t41449_1
v1_0001-Add-an-a-appname-command-line-switch-to-control-the.patchtext/x-patch; charset=UTF-8; name=v1_0001-Add-an-a-appname-command-line-switch-to-control-the.patchDownload+59-4
#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Jesper Pedersen (#1)
Re: Application name for pg_basebackup and friends

On 31/10/2019 14:52, Jesper Pedersen wrote:

Hi,

The attached patch adds an -a / --appname command line switch to
pg_basebackup, pg_receivewal and pg_recvlogical.

This is useful when f.ex. pg_receivewal needs to connect as a
synchronous client (synchronous_standby_names),

pg_receivewal -h myhost -p 5432 -S replica1 -a replica1 --synchronous
-D /wal

I'll add the patch to the CommitFest for discussion, as there is overlap
with the -d switch.

You can already set application name with the environment variable or on
the database connections string:

pg_receivewal -D /wal -d "host=myhost application_name=myreceiver"

I don't think we need a new comand line switch for it.

- Heikki

#3Michael Paquier
michael@paquier.xyz
In reply to: Heikki Linnakangas (#2)
Re: Application name for pg_basebackup and friends

On Thu, Oct 31, 2019 at 03:10:35PM +0200, Heikki Linnakangas wrote:

You can already set application name with the environment variable or on the
database connections string:

pg_receivewal -D /wal -d "host=myhost application_name=myreceiver"

I don't think we need a new comand line switch for it.

+1.
--
Michael
#4Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#3)
Re: Application name for pg_basebackup and friends

On Sat, Nov 02, 2019 at 04:45:40PM +0900, Michael Paquier wrote:

On Thu, Oct 31, 2019 at 03:10:35PM +0200, Heikki Linnakangas wrote:

You can already set application name with the environment variable or on the
database connections string:

pg_receivewal -D /wal -d "host=myhost application_name=myreceiver"

I don't think we need a new comand line switch for it.

+1.

Please note that I have marked this patch as rejected in the CF app,
per the arguments upthread.
--
Michael

#5Jesper Pedersen
jesper.pedersen@redhat.com
In reply to: Michael Paquier (#4)
Re: Application name for pg_basebackup and friends

On 11/7/19 1:51 AM, Michael Paquier wrote:

I don't think we need a new comand line switch for it.

+1.

Please note that I have marked this patch as rejected in the CF app,
per the arguments upthread.

Ok, agreed.

Thanks for the feedback !

Best regards,
Jesper