*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.16 2010/04/12 10:18:50 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.17 2010/04/21 00:51:56 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "replication/walsender.h"
#include "storage/fd.h"
#include "storage/ipc.h"
-#include "storage/lock.h"
#include "storage/pmsignal.h"
#include "tcop/tcopprot.h"
#include "utils/guc.h"
#include "utils/memutils.h"
#include "utils/ps_status.h"
+
/* Array of WalSnds in shared memory */
WalSndCtlData *WalSndCtl = NULL;
{
MemoryContext walsnd_context;
- if (!superuser())
- ereport(FATAL,
- (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("must be superuser to start walsender")));
-
if (RecoveryInProgress())
ereport(FATAL,
(errcode(ERRCODE_CANNOT_CONNECT_NOW),
*
*
* 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 $
*
*
*-------------------------------------------------------------------------
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 */