aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/init/postinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r--src/backend/utils/init/postinit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 1fc41cce676..b812c40ac0e 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.210 2010/04/20 23:48:47 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.211 2010/04/21 00:51:57 tgl Exp $
*
*
*-------------------------------------------------------------------------
@@ -624,6 +624,11 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
if (am_walsender)
{
Assert(!bootstrap);
+ /* must have authenticated as a superuser */
+ if (!am_superuser)
+ ereport(FATAL,
+ (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
+ errmsg("must be superuser to start walsender")));
/* report this backend in the PgBackendStatus array */
pgstat_bestart();
/* close the transaction we started above */