public inbox for [email protected]  
help / color / mirror / Atom feed
docu bug?
5+ messages / 4 participants
[nested] [flat]

* docu bug?
@ 2018-02-19 13:54 PG Doc comments form <[email protected]>
  2018-02-19 13:56 ` Re: docu bug? Salvador Jacinto <[email protected]>
  2018-02-20 01:25 ` Re: docu bug? Michael Paquier <[email protected]>
  0 siblings, 2 replies; 5+ messages in thread

From: PG Doc comments form @ 2018-02-19 13:54 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

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>


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: docu bug?
  2018-02-19 13:54 docu bug? PG Doc comments form <[email protected]>
@ 2018-02-19 13:56 ` Salvador Jacinto <[email protected]>
  1 sibling, 0 replies; 5+ messages in thread

From: Salvador Jacinto @ 2018-02-19 13:56 UTC (permalink / raw)
  To: [email protected]; [email protected]

POR FAVOR TRADUZIR

Em 19/02/2018 9:55 AM, "PG Doc comments form" <[email protected]>
escreveu:

> 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>
>


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: docu bug?
  2018-02-19 13:54 docu bug? PG Doc comments form <[email protected]>
@ 2018-02-20 01:25 ` Michael Paquier <[email protected]>
  2018-02-20 08:00   ` AW: docu bug? Zwettler Markus (OIZ) <[email protected]>
  1 sibling, 1 reply; 5+ messages in thread

From: Michael Paquier @ 2018-02-20 01:25 UTC (permalink / raw)
  To: [email protected]; [email protected]

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


Attachments:

  [application/pgp-signature] signature.asc (833B, 2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* AW: docu bug?
  2018-02-19 13:54 docu bug? PG Doc comments form <[email protected]>
  2018-02-20 01:25 ` Re: docu bug? Michael Paquier <[email protected]>
@ 2018-02-20 08:00   ` Zwettler Markus (OIZ) <[email protected]>
  2018-02-20 09:55     ` Re: docu bug? Michael Paquier <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Zwettler Markus (OIZ) @ 2018-02-20 08:00 UTC (permalink / raw)
  To: Michael Paquier <[email protected]>; [email protected] <[email protected]>

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:[email protected]] 
Gesendet: Dienstag, 20. Februar 2018 02:25
An: Zwettler Markus (OIZ) <[email protected]>; [email protected]
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




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: docu bug?
  2018-02-19 13:54 docu bug? PG Doc comments form <[email protected]>
  2018-02-20 01:25 ` Re: docu bug? Michael Paquier <[email protected]>
  2018-02-20 08:00   ` AW: docu bug? Zwettler Markus (OIZ) <[email protected]>
@ 2018-02-20 09:55     ` Michael Paquier <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: Michael Paquier @ 2018-02-20 09:55 UTC (permalink / raw)
  To: Zwettler Markus (OIZ) <[email protected]>; +Cc: [email protected] <[email protected]>

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:

  [text/x-diff] backup-doc-exclusive.patch (541B, 2-backup-doc-exclusive.patch)
  download | inline diff:
diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml
index 9d8e69056f..54ead81e51 100644
--- a/doc/src/sgml/backup.sgml
+++ b/doc/src/sgml/backup.sgml
@@ -1466,7 +1466,7 @@ archive_command = 'test ! -f /var/lib/pgsql/backup_in_progress || (test ! -f /va
 
      <para>
       With this preparation, a backup can be taken using a script like the
-      following:
+      following, which uses the exclusive backup method:
 <programlisting>
 touch /var/lib/pgsql/backup_in_progress
 psql -c "select pg_start_backup('hot_backup');"


  [application/pgp-signature] signature.asc (833B, 3-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2018-02-20 09:55 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19 13:54 docu bug? PG Doc comments form <[email protected]>
2018-02-19 13:56 ` Salvador Jacinto <[email protected]>
2018-02-20 01:25 ` Michael Paquier <[email protected]>
2018-02-20 08:00   ` AW: docu bug? Zwettler Markus (OIZ) <[email protected]>
2018-02-20 09:55     ` Michael Paquier <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox