Help text for pg_basebackup -R

Started by Magnus Haganderover 9 years ago7 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:t36039
psql -h localhost -U postgres

Built from patchset v1 (message #1), July 28, 2026 at 08:18 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 t36039_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 t36039_1 && git checkout t36039_1

Patchset v1 (message #1) is on t36039_1

Jump to latest
#1Magnus Hagander
magnus@hagander.net

The current help text for pg_basebackup -R is "write recovery.conf after
backup".

This says nothing about what it actually does. I've had a number of people
ask me now why that's not default "because you need a recovery.conf to
restore from backup". The point being that it doesn't say anything about
the fact that it writes the file *for replication*. The help page does, but
not the message.

I propose a new message per the attached patch.

Comments?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

Attachments:

t36039_1
pg_basebackup_recovery_help.patchtext/x-patch; charset=US-ASCII; name=pg_basebackup_recovery_help.patchDownload+1-1
#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Magnus Hagander (#1)
Re: Help text for pg_basebackup -R

Magnus Hagander wrote:

printf(_("  -R, --write-recovery-conf\n"
-			 "                         write recovery.conf after backup\n"));
+			 "                         write recovery.conf for replication\n"));
printf(_("  -S, --slot=SLOTNAME    replication slot to use\n"));

LGTM.

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Magnus Hagander
magnus@hagander.net
In reply to: Alvaro Herrera (#2)
Re: Help text for pg_basebackup -R

On Wednesday, February 15, 2017, Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

Magnus Hagander wrote:

printf(_(" -R, --write-recovery-conf\n"
- " write recovery.conf

after backup\n"));

+ " write recovery.conf for

replication\n"));

printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));

LGTM.

I'm guessing if we backpatch something like that, it would cause issues for
translations, right? So we should make it head only?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

#4Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Magnus Hagander (#3)
Re: Help text for pg_basebackup -R

Magnus Hagander wrote:

On Wednesday, February 15, 2017, Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

Magnus Hagander wrote:

printf(_(" -R, --write-recovery-conf\n"
- " write recovery.conf

after backup\n"));

+ " write recovery.conf for

replication\n"));

printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));

LGTM.

I'm guessing if we backpatch something like that, it would cause issues for
translations, right? So we should make it head only?

We've had the argument a number of times. My stand is that many
translators are active in the older branches, so this update would be
caught there too; and even if not, an updated English message is better
than an outdated native-language message.

Now, that's been argued in the context of a bug fix that introduces new
messages or changed an existing message for other reasons. I'm not sure
how strongly do we think it applies for a change that's *only* about
updating a message. I'm +0.5 on back-patching the change in this case.

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Stephen Frost
sfrost@snowman.net
In reply to: Alvaro Herrera (#4)
Re: Help text for pg_basebackup -R

* Alvaro Herrera (alvherre@2ndquadrant.com) wrote:

Magnus Hagander wrote:

On Wednesday, February 15, 2017, Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

Magnus Hagander wrote:

printf(_(" -R, --write-recovery-conf\n"
- " write recovery.conf

after backup\n"));

+ " write recovery.conf for

replication\n"));

printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));

LGTM.

I'm guessing if we backpatch something like that, it would cause issues for
translations, right? So we should make it head only?

We've had the argument a number of times. My stand is that many
translators are active in the older branches, so this update would be
caught there too; and even if not, an updated English message is better
than an outdated native-language message.

That makes sense to me, at least, so +1, for my part. Of course, I'm
not a translation-using user, but I have heard from people when I've
spoken in other countries that a correct english message is better than
outdated native-language messages, and further, that having the English
message makes it easier to get Google results.

Thanks!

Stephen

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stephen Frost (#5)
Re: Help text for pg_basebackup -R

Stephen Frost <sfrost@snowman.net> writes:

* Alvaro Herrera (alvherre@2ndquadrant.com) wrote:

Magnus Hagander wrote:

I'm guessing if we backpatch something like that, it would cause issues for
translations, right? So we should make it head only?

We've had the argument a number of times. My stand is that many
translators are active in the older branches, so this update would be
caught there too; and even if not, an updated English message is better
than an outdated native-language message.

That makes sense to me, at least, so +1, for my part.

Yeah, if the existing message text is actually wrong or misleading,
we should back-patch. I'm not sure I would do that if it's just a
cosmetic improvement. In this particular case, +1.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#7Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#6)
Re: Help text for pg_basebackup -R

On Fri, Feb 17, 2017 at 5:21 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Stephen Frost <sfrost@snowman.net> writes:

* Alvaro Herrera (alvherre@2ndquadrant.com) wrote:

Magnus Hagander wrote:

I'm guessing if we backpatch something like that, it would cause

issues for

translations, right? So we should make it head only?

We've had the argument a number of times. My stand is that many
translators are active in the older branches, so this update would be
caught there too; and even if not, an updated English message is better
than an outdated native-language message.

That makes sense to me, at least, so +1, for my part.

Yeah, if the existing message text is actually wrong or misleading,
we should back-patch. I'm not sure I would do that if it's just a
cosmetic improvement. In this particular case, +1.

OK. Applied and backpatched.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/