Make sure pg_rewind can't run as root

Previously a warning was printed, but the tool actually kept running
even when running as root. This is something we definitely want to
prevent, but since this means a behavior change, not backpatching.

Author: Michael Paquier
This commit is contained in:
Magnus Hagander 2018-04-09 21:33:33 +02:00
parent a65e17bd6f
commit 5d5aeddabf
1 changed files with 1 additions and 0 deletions

View File

@ -208,6 +208,7 @@ main(int argc, char **argv)
fprintf(stderr, _("cannot be executed by \"root\"\n"));
fprintf(stderr, _("You must run %s as the PostgreSQL superuser.\n"),
progname);
exit(1);
}
#endif