Subject: Proposal: Add backup start time to pg_stat_progress_basebackup

From: Rob Moore <[email-masked]>
Date: Tue, 20 Jan 2026 10:33:23 +0800

Hi all,

We're currently working on upgrading our application from using pg14 to
pg18. We've managing the database ourselves, and that includes backups. We
were previously using exclusive backups, but are changing that to use
pg_basebackup instead. We had a health check that reported on in-progress
backups using pg_backup_start_time(), but of course since that's gone, I
wanted a replacement for base backups. Reading around, the natural home for
that information would appear to be pg_stat_progress_basebackup, but it
isn't one of the columns of that view.

Was backup start time intentionally omitted
from pg_stat_progress_basebackup, or would it be okay for me or someone
else to add it as a column? Or, am I being daft and there is another
obvious way to get the start time for an in-progress base backup?

(I would have no idea where to start, but I'm enthusiastic about having a
go, and on the face of it this seems like it might be a fairly accessible
task for a first-time contributor)

Thanks,
Rob

---

From: "David G. Johnston" <[email-masked]>
Date: Mon, 19 Jan 2026 20:22:28 -0700

On Monday, January 19, 2026, Rob Moore <[email-masked]> wrote:
>
>
> Was backup start time intentionally omitted from pg_stat_progress_basebackup,
> or would it be okay for me or someone else to add it as a column? Or, am I
> being daft and there is another obvious way to get the start time for an
> in-progress base backup?
>
>
Not sure about base backup but the other progress reporting commands would
get that info from pg_stat_activity.query_start which can be joined to
using pid.  backend_start is likely close enough for pg_basebackup if it
doesn’t recognize the replication protocol as a “command”.  I haven’t
checked.

David J.

---

From: Rob Moore <[email-masked]>
Date: Tue, 20 Jan 2026 11:46:23 +0800

Thanks David, I've just tried this, and joining to pg_stat_activity on pid
works great. I'll do that.

Sorry for the noise 😅,
Rob