On 26/10/2026 13:42, David Steele wrote:
On 10/23/26 18:17, Heikki Linnakangas wrote:
On 23/10/2026 15:42, David Steele wrote:
Umm, not new with his patch, but why do we still have that hint to remove backup_label? Is that ever the right thing to do? Why didn't we remove that hint when exclusive-mode backups were removed?

Unfortunately I believe there is still a use case for this hint. When making a backup, e.g. via snapshot, it is still easier to write the backup_label into PGDATA, make the snapshot, then remove it. If the cluster crashes before the removal then the answer is to remove the backup label, just as it was if exclusive backup crashed.

I'm not excited about the above use case but not sure we can discount it entirely.

If you take an atomic filesystem-level snapshot, restoring it is equivalent to crash recovery, so you don't need a backup_label to restore it to a consistent state. There's no need for pg_start_backup() or a backup_label in that case. Admittedly, a non-atomic snapshot is a different story.

But I don't see how you could do that anyway. The backup_label is returned by pg_stop_backup(). If the sequence is:

1. pg_start_backup()
2. take filesystem snapshot
3. pg_stop_backup()

there's no way to include the backup_label in the snapshot, because you don't have it until you call pg_stop_backup().

- Heikki



Reply via email to