pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedThe pg_stop_backup will return one row with three values.
6+ messages / 5 participants
[nested] [flat]
* The pg_stop_backup will return one row with three values.
@ 2021-12-19 21:08 PG Doc comments form <noreply@postgresql.org>
2021-12-20 12:03 ` Re: The pg_stop_backup will return one row with three values. Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 1 reply; 6+ messages in thread
From: PG Doc comments form @ 2021-12-19 21:08 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: davecramer@postgres.rocks
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/14/continuous-archiving.html
Description:
It appears that this may be out of date.
pg_stop_backup
---------------------------------------------------------------------------
(0/2000138,"START WAL LOCATION: 0/2000028 (file
000000010000000000000002)+
CHECKPOINT LOCATION: 0/2000060
+
BACKUP METHOD: streamed
+
BACKUP FROM: primary
+
START TIME: 2021-12-19 13:39:19 EST
+
LABEL: label
+
START TIMELINE: 1
+
","")
Seems to be returning 7 values ?
Dave
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: The pg_stop_backup will return one row with three values.
2021-12-19 21:08 The pg_stop_backup will return one row with three values. PG Doc comments form <noreply@postgresql.org>
@ 2021-12-20 12:03 ` Laurenz Albe <laurenz.albe@cybertec.at>
2021-12-20 12:19 ` Re: The pg_stop_backup will return one row with three values. Dave Cramer <davecramer@postgres.rocks>
0 siblings, 1 reply; 6+ messages in thread
From: Laurenz Albe @ 2021-12-20 12:03 UTC (permalink / raw)
To: davecramer@postgres.rocks; pgsql-docs@lists.postgresql.org
On Sun, 2021-12-19 at 21:08 +0000, PG Doc comments form wrote:
> Page: https://www.postgresql.org/docs/14/continuous-archiving.html
> Description:
>
> It appears that this may be out of date.
>
> pg_stop_backup
> ---------------------------------------------------------------------------
> (0/2000138,"START WAL LOCATION: 0/2000028 (file 000000010000000000000002)+
> CHECKPOINT LOCATION: 0/2000060 +
> BACKUP METHOD: streamed +
> BACKUP FROM: primary +
> START TIME: 2021-12-19 13:39:19 EST +
> LABEL: label +
> START TIMELINE: 1 +
> ","")
>
>
> Seems to be returning 7 values ?
No, that is one value with 7 newlines in it.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: The pg_stop_backup will return one row with three values.
2021-12-19 21:08 The pg_stop_backup will return one row with three values. PG Doc comments form <noreply@postgresql.org>
2021-12-20 12:03 ` Re: The pg_stop_backup will return one row with three values. Laurenz Albe <laurenz.albe@cybertec.at>
@ 2021-12-20 12:19 ` Dave Cramer <davecramer@postgres.rocks>
2021-12-20 12:47 ` Re: The pg_stop_backup will return one row with three values. Michael Paquier <michael@paquier.xyz>
2021-12-20 13:12 ` Re: The pg_stop_backup will return one row with three values. Julien Rouhaud <rjuju123@gmail.com>
0 siblings, 2 replies; 6+ messages in thread
From: Dave Cramer @ 2021-12-20 12:19 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Pg Docs <pgsql-docs@lists.postgresql.org>
On Mon, 20 Dec 2021 at 07:03, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> On Sun, 2021-12-19 at 21:08 +0000, PG Doc comments form wrote:
> > Page: https://www.postgresql.org/docs/14/continuous-archiving.html
> > Description:
> >
> > It appears that this may be out of date.
> >
> > pg_stop_backup
> >
> ---------------------------------------------------------------------------
> > (0/2000138,"START WAL LOCATION: 0/2000028 (file
> 000000010000000000000002)+
> > CHECKPOINT LOCATION: 0/2000060
> +
> > BACKUP METHOD:
> streamed +
> > BACKUP FROM:
> primary +
> > START TIME: 2021-12-19 13:39:19
> EST +
> > LABEL:
> label +
> > START TIMELINE:
> 1 +
> > ","")
> >
> >
> > Seems to be returning 7 values ?
>
> No, that is one value with 7 newlines in it.
>
>
The docs say it returns 3 values ?
Dave
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: The pg_stop_backup will return one row with three values.
2021-12-19 21:08 The pg_stop_backup will return one row with three values. PG Doc comments form <noreply@postgresql.org>
2021-12-20 12:03 ` Re: The pg_stop_backup will return one row with three values. Laurenz Albe <laurenz.albe@cybertec.at>
2021-12-20 12:19 ` Re: The pg_stop_backup will return one row with three values. Dave Cramer <davecramer@postgres.rocks>
@ 2021-12-20 12:47 ` Michael Paquier <michael@paquier.xyz>
1 sibling, 0 replies; 6+ messages in thread
From: Michael Paquier @ 2021-12-20 12:47 UTC (permalink / raw)
To: Dave Cramer <davecramer@postgres.rocks>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; Pg Docs <pgsql-docs@lists.postgresql.org>
On Mon, Dec 20, 2021 at 07:19:32AM -0500, Dave Cramer wrote:
> The docs say it returns 3 values ?
They do. Here is the relevant part:
https://www.postgresql.org/docs/devel/functions-admin.html#FUNCTIONS-ADMIN-BACKUP
"The result of the function is a single record. The lsn column holds
the backup's ending write-ahead log location (which again can be
ignored). The second and third columns are NULL when ending an
exclusive backup; after a non-exclusive backup they hold the desired
contents of the label and tablespace map files."
For exclusive backups, where pg_stop_backup() is used without an
argument, 1 row is returned with the LSN marking the end of the
backup. When pg_stop_backup(true) is used, you would get one row with
three attributes: the end LSN, the label file as NULL and a tablespace
map as NULL.
For non-exclusive backups, pg_stop_backup(false) returns those three
fields, all of them being not NULL. pg_stop_backup() without an
argument cannot be used for non-exclusive backups.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../../YcB7UiwHj0Zk5BhN@paquier.xyz/2-signature.asc)
download
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: The pg_stop_backup will return one row with three values.
2021-12-19 21:08 The pg_stop_backup will return one row with three values. PG Doc comments form <noreply@postgresql.org>
2021-12-20 12:03 ` Re: The pg_stop_backup will return one row with three values. Laurenz Albe <laurenz.albe@cybertec.at>
2021-12-20 12:19 ` Re: The pg_stop_backup will return one row with three values. Dave Cramer <davecramer@postgres.rocks>
@ 2021-12-20 13:12 ` Julien Rouhaud <rjuju123@gmail.com>
2021-12-20 13:34 ` Re: The pg_stop_backup will return one row with three values. Dave Cramer <davecramer@postgres.rocks>
1 sibling, 1 reply; 6+ messages in thread
From: Julien Rouhaud @ 2021-12-20 13:12 UTC (permalink / raw)
To: Dave Cramer <davecramer@postgres.rocks>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; Pg Docs <pgsql-docs@lists.postgresql.org>
On Mon, Dec 20, 2021 at 8:19 PM Dave Cramer <davecramer@postgres.rocks> wrote:
>
> On Mon, 20 Dec 2021 at 07:03, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>>
>> On Sun, 2021-12-19 at 21:08 +0000, PG Doc comments form wrote:
>> > Page: https://www.postgresql.org/docs/14/continuous-archiving.html
>> > Description:
>> >
>> > It appears that this may be out of date.
>> >
>> > pg_stop_backup
>> > ---------------------------------------------------------------------------
>> > (0/2000138,"START WAL LOCATION: 0/2000028 (file 000000010000000000000002)+
>> > CHECKPOINT LOCATION: 0/2000060 +
>> > BACKUP METHOD: streamed +
>> > BACKUP FROM: primary +
>> > START TIME: 2021-12-19 13:39:19 EST +
>> > LABEL: label +
>> > START TIMELINE: 1 +
>> > ","")
>> >
>> >
>> > Seems to be returning 7 values ?
>>
>> No, that is one value with 7 newlines in it.
>>
>
> The docs say it returns 3 values ?
It's 3 values, one of them containing a lot of newlines. To make it clearer:
=# select (pg_stop_backup(false, false)).*;
lsn | labelfile
| spcmapfile
-----------+---------------------------------------------------------------+------------
0/9000138 | START WAL LOCATION: 0/9000028 (file 000000010000000000000009)+|
| CHECKPOINT LOCATION: 0/9000060 +|
| BACKUP METHOD: streamed +|
| BACKUP FROM: primary +|
| START TIME: 2021-12-20 21:11:10 CST +|
| LABEL: meh +|
| START TIMELINE: 1 +|
| |
(1 row)
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: The pg_stop_backup will return one row with three values.
2021-12-19 21:08 The pg_stop_backup will return one row with three values. PG Doc comments form <noreply@postgresql.org>
2021-12-20 12:03 ` Re: The pg_stop_backup will return one row with three values. Laurenz Albe <laurenz.albe@cybertec.at>
2021-12-20 12:19 ` Re: The pg_stop_backup will return one row with three values. Dave Cramer <davecramer@postgres.rocks>
2021-12-20 13:12 ` Re: The pg_stop_backup will return one row with three values. Julien Rouhaud <rjuju123@gmail.com>
@ 2021-12-20 13:34 ` Dave Cramer <davecramer@postgres.rocks>
0 siblings, 0 replies; 6+ messages in thread
From: Dave Cramer @ 2021-12-20 13:34 UTC (permalink / raw)
To: Julien Rouhaud <rjuju123@gmail.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; Pg Docs <pgsql-docs@lists.postgresql.org>
On Mon, 20 Dec 2021 at 08:12, Julien Rouhaud <rjuju123@gmail.com> wrote:
> On Mon, Dec 20, 2021 at 8:19 PM Dave Cramer <davecramer@postgres.rocks>
> wrote:
> >
> > On Mon, 20 Dec 2021 at 07:03, Laurenz Albe <laurenz.albe@cybertec.at>
> wrote:
> >>
> >> On Sun, 2021-12-19 at 21:08 +0000, PG Doc comments form wrote:
> >> > Page: https://www.postgresql.org/docs/14/continuous-archiving.html
> >> > Description:
> >> >
> >> > It appears that this may be out of date.
> >> >
> >> > pg_stop_backup
> >> >
> ---------------------------------------------------------------------------
> >> > (0/2000138,"START WAL LOCATION: 0/2000028 (file
> 000000010000000000000002)+
> >> > CHECKPOINT LOCATION: 0/2000060
> +
> >> > BACKUP METHOD: streamed
> +
> >> > BACKUP FROM: primary
> +
> >> > START TIME: 2021-12-19 13:39:19 EST
> +
> >> > LABEL: label
> +
> >> > START TIMELINE: 1
> +
> >> > ","")
> >> >
> >> >
> >> > Seems to be returning 7 values ?
> >>
> >> No, that is one value with 7 newlines in it.
> >>
> >
> > The docs say it returns 3 values ?
>
> It's 3 values, one of them containing a lot of newlines. To make it
> clearer:
>
> =# select (pg_stop_backup(false, false)).*;
> lsn | labelfile
> | spcmapfile
>
> -----------+---------------------------------------------------------------+------------
> 0/9000138 | START WAL LOCATION: 0/9000028 (file
> 000000010000000000000009)+|
> | CHECKPOINT LOCATION: 0/9000060
> +|
> | BACKUP METHOD: streamed
> +|
> | BACKUP FROM: primary
> +|
> | START TIME: 2021-12-20 21:11:10 CST
> +|
> | LABEL: meh
> +|
> | START TIMELINE: 1
> +|
> |
> |
> (1 row)
>
Thanks Julien, that makes more sense, although I have to say this part of
the manual is pretty tough reading.
Dave
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2021-12-20 13:34 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-12-19 21:08 The pg_stop_backup will return one row with three values. PG Doc comments form <noreply@postgresql.org>
2021-12-20 12:03 ` Laurenz Albe <laurenz.albe@cybertec.at>
2021-12-20 12:19 ` Dave Cramer <davecramer@postgres.rocks>
2021-12-20 12:47 ` Michael Paquier <michael@paquier.xyz>
2021-12-20 13:12 ` Julien Rouhaud <rjuju123@gmail.com>
2021-12-20 13:34 ` Dave Cramer <davecramer@postgres.rocks>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox