forbid_cascading_standby_0218.patch

text/x-patch

Filename: forbid_cascading_standby_0218.patch
Type: text/x-patch
Part: 0
Message: Re: Streaming replication, and walsender during recovery

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: context
File+
src/backend/replication/walsender.c 6 0
*** a/src/backend/replication/walsender.c
--- b/src/backend/replication/walsender.c
***************
*** 119,124 **** WalSenderMain(void)
--- 119,130 ----
  				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
  				 errmsg("must be superuser to start walsender")));
  
+ 	if (RecoveryInProgress())
+ 		ereport(FATAL,
+ 				(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ 				 errmsg("recovery is in progress"),
+ 				 errhint("cannot accept the standby server during recovery.")));
+ 
  	/* Create a per-walsender data structure in shared memory */
  	InitWalSnd();