How to tell if server is in backup mode?

Started by Toby Corkindaleabout 14 years ago4 messagesgeneral
Jump to latest
#1Toby Corkindale
toby.corkindale@strategicdata.com.au

Hi,
I can start and stop backup mode with pg_start_backup() and
pg_stop_backup().

Is there any function like pg_is_in_backup() to tell if the mode has
been enabled?

(I can't find anything in the 9.1 docs)

Cheers,
Toby

#2Gabriele Bartolini
gabriele.bartolini@2ndQuadrant.it
In reply to: Toby Corkindale (#1)
Re: How to tell if server is in backup mode?

Hi Toby,

Il 28/03/12 09:14, Toby Corkindale ha scritto:

Is there any function like pg_is_in_backup() to tell if the mode has
been enabled?

Currently, there's no such a function. In general we simply check if a
'backup_label' file exists in PGDATA. However, it could be a good idea
to add it as admin function (I will have a think about it and possibly
come up with a patch).

Ciao,
Gabriele

--
Gabriele Bartolini - 2ndQuadrant Italia
PostgreSQL Training, Services and Support
gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it

#3Gabriele Bartolini
gabriele.bartolini@2ndQuadrant.it
In reply to: Gabriele Bartolini (#2)
Re: How to tell if server is in backup mode?

Hi Toby,

Il 29/03/12 10:46, Gabriele Bartolini ha scritto:

Currently, there's no such a function. In general we simply check if a
'backup_label' file exists in PGDATA. However, it could be a good idea
to add it as admin function (I will have a think about it and possibly
come up with a patch).

My bad (thanks Carlo Ascani for pointing this out to me). Gilles Darold
just proposed such a patch and I looked into the commitfest website:
https://commitfest.postgresql.org/action/patch_view?id=803

I just added myself as a reviewer for PostgreSQL 9.3.

Cheers,
Gabriele

--
Gabriele Bartolini - 2ndQuadrant Italia
PostgreSQL Training, Services and Support
gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it

#4Toby Corkindale
toby.corkindale@strategicdata.com.au
In reply to: Gabriele Bartolini (#3)
Re: How to tell if server is in backup mode?

On 29/03/12 19:50, Gabriele Bartolini wrote:

Hi Toby,

Il 29/03/12 10:46, Gabriele Bartolini ha scritto:

Currently, there's no such a function. In general we simply check if a
'backup_label' file exists in PGDATA. However, it could be a good idea
to add it as admin function (I will have a think about it and possibly
come up with a patch).

My bad (thanks Carlo Ascani for pointing this out to me). Gilles Darold
just proposed such a patch and I looked into the commitfest website:
https://commitfest.postgresql.org/action/patch_view?id=803

I just added myself as a reviewer for PostgreSQL 9.3.

Cool, good to know it's on its way :)

Thanks Gabriele,

Toby