docu bug?

Started by PG Bug reporting formover 8 years ago5 messagesdocs
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:t76163
psql -h localhost -U postgres

Built from patchset v5 (message #5), July 27, 2026 at 09:07 PM.

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 t76163_5 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 t76163_5 && git checkout t76163_5

Patchset v5 (message #5) is on t76163_5

Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.6/static/continuous-archiving.html
Description:

Seems to need a persistent connection:

<quote>
25.3.3.1. Making a non-exclusive low level backup
...
The connection calling pg_start_backup must be maintained until the end of
the backup, or the backup will be automatically aborted.
...
</Quote>

The sample works with a NON-persistent connection (psql -c):

<quote>
25.3.6.1. Standalone Hot Backups
... touch /var/lib/pgsql/backup_in_progress
psql -c "select pg_start_backup('hot_backup');"
tar -cf /var/lib/pgsql/backup.tar /var/lib/pgsql/data/
psql -c "select pg_stop_backup();"
rm /var/lib/pgsql/backup_in_progress
tar -rf /var/lib/pgsql/backup.tar /var/lib/pgsql/archive/
...
</quote>

#2Salvador Jacinto
salvadorjacinto88@gmail.com
In reply to: PG Bug reporting form (#1)
Re: docu bug?

POR FAVOR TRADUZIR

Em 19/02/2018 9:55 AM, "PG Doc comments form" <noreply@postgresql.org>
escreveu:

Show quoted text

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.6/static/continuous-archiving.html
Description:

Seems to need a persistent connection:

<quote>
25.3.3.1. Making a non-exclusive low level backup
...
The connection calling pg_start_backup must be maintained until the end of
the backup, or the backup will be automatically aborted.
...
</Quote>

The sample works with a NON-persistent connection (psql -c):

<quote>
25.3.6.1. Standalone Hot Backups
... touch /var/lib/pgsql/backup_in_progress
psql -c "select pg_start_backup('hot_backup');"
tar -cf /var/lib/pgsql/backup.tar /var/lib/pgsql/data/
psql -c "select pg_stop_backup();"
rm /var/lib/pgsql/backup_in_progress
tar -rf /var/lib/pgsql/backup.tar /var/lib/pgsql/archive/
...
</quote>

#3Michael Paquier
michael@paquier.xyz
In reply to: PG Bug reporting form (#1)
Re: docu bug?

On Mon, Feb 19, 2018 at 01:54:24PM +0000, PG Doc comments form wrote:

The sample works with a NON-persistent connection (psql -c):

<quote>
25.3.6.1. Standalone Hot Backups
... touch /var/lib/pgsql/backup_in_progress
psql -c "select pg_start_backup('hot_backup');"
tar -cf /var/lib/pgsql/backup.tar /var/lib/pgsql/data/
psql -c "select pg_stop_backup();"
rm /var/lib/pgsql/backup_in_progress
tar -rf /var/lib/pgsql/backup.tar /var/lib/pgsql/archive/
...
</quote>

This uses the set of exclusive backup APIs, so with non-persistent
connections the backup can be correctly completed. Non-exclusive
backups can be defined using 'false' as third argument of
pg_start_backup() and first argument of pg_stop_backup(). Note that for
pg_start_backup you would also need to define the second boolean
argument to decide if a checkpoint should be immediately taken or not.
So you would have basically the following flow on a persistem
connection:
=# SELECT pg_start_backup('my_backup', true_or_false, false);
-- keep connection alive and do stuff.
=# SELECT pg_stop_backup(false);

Do you think that the section "Tips and Examples" should mention
that an exclusive backup method is used for this example? This may
reduce the confusion.
--
Michael

#4Zwettler Markus (OIZ)
Markus.Zwettler@zuerich.ch
In reply to: Michael Paquier (#3)
AW: docu bug?

Yes. I think the exclusive backup method should be mentioned especially as it is the older one.

- Markus

-----Ursprüngliche Nachricht-----
Von: Michael Paquier [mailto:michael@paquier.xyz]
Gesendet: Dienstag, 20. Februar 2018 02:25
An: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>; pgsql-docs@lists.postgresql.org
Betreff: Re: docu bug?

On Mon, Feb 19, 2018 at 01:54:24PM +0000, PG Doc comments form wrote:

The sample works with a NON-persistent connection (psql -c):

<quote>
25.3.6.1. Standalone Hot Backups
... touch /var/lib/pgsql/backup_in_progress
psql -c "select pg_start_backup('hot_backup');"
tar -cf /var/lib/pgsql/backup.tar /var/lib/pgsql/data/ psql -c "select
pg_stop_backup();"
rm /var/lib/pgsql/backup_in_progress
tar -rf /var/lib/pgsql/backup.tar /var/lib/pgsql/archive/ ...
</quote>

This uses the set of exclusive backup APIs, so with non-persistent connections the backup can be correctly completed. Non-exclusive backups can be defined using 'false' as third argument of
pg_start_backup() and first argument of pg_stop_backup(). Note that for pg_start_backup you would also need to define the second boolean argument to decide if a checkpoint should be immediately taken or not.
So you would have basically the following flow on a persistem
connection:
=# SELECT pg_start_backup('my_backup', true_or_false, false);
-- keep connection alive and do stuff.
=# SELECT pg_stop_backup(false);

Do you think that the section "Tips and Examples" should mention that an exclusive backup method is used for this example? This may reduce the confusion.
--
Michael

#5Michael Paquier
michael@paquier.xyz
In reply to: Zwettler Markus (OIZ) (#4)
Re: docu bug?

On Tue, Feb 20, 2018 at 08:00:35AM +0000, Zwettler Markus (OIZ) wrote:

Yes. I think the exclusive backup method should be mentioned
especially as it is the older one.

Attached is a suggestion of patch. What do you think?
--
Michael

Attachments:

t76163_5
backup-doc-exclusive.patchtext/x-diff; charset=us-asciiDownload+1-1