Hi
We encountered an unfortunate case of $SUBJECT the other day where it
would have been preferable to catch the error before rather than after pg_basebackup ran.
I can't think of any practical reason why pg_basebackup would ever need to
be run as root; we disallow that for initdb, pg_ctl and pg_upgrade, so it
seems reasonable to do the same for pg_basebackup. Trivial patch attached,
which as with the other cases will allow only the --help/--version options
to be executed as root, otherwise nothing else.
The patch doesn't update the pg_basebackup documentation page; we don't
mention it in the pg_ctl and pg_upgrade pages either and it doesn't seem
particularly important to mention it explicitly.
I'll add this to the March CF.
Regards
Ian Barwick