Risks of pg_start_backup() I want to know the risks of the pg_start_backup() control function.

For example, what will happen if someone resets the server, or if there is a power failure during pg_start_backup's operation?

What will happen if something goes wrong with the postgres process and it just gets out?

What will happen if the hard drive goes full with this option enabled?
First and most importantly, the great majority of users should simply use pg_basebackup. For those few it is unsuitable for, there are existing tools you should use instead of rolling your own, like PgBarman, WAL-E and OmniPITR.



If the server crashes mid-backup when using pg_basebackup you might need to remove the backup.label file from the data directory manually. It can result in some increased table bloat while it's running but is otherwise very safe.

Note that PostgreSQL 9.6 addresses the issue with the leftover backup.label file by providing a new API that returns the backup label file over the SQL connection. See the release wiki and docs. You should strongly prefer to use this mode when backing up 9.6 or newer.