no_evt_trig_when_standalone.patch

text/x-patch

Filename: no_evt_trig_when_standalone.patch
Type: text/x-patch
Part: 0
Message: Re: Use of systable_beginscan_ordered in event trigger patch

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/commands/event_trigger.c 13 0
*** a/src/backend/commands/event_trigger.c
--- b/src/backend/commands/event_trigger.c
***************
*** 567,572 **** EventTriggerDDLCommandStart(Node *parsetree)
--- 567,585 ----
  	EventTriggerData	trigdata;
  
  	/*
+ 	 * Event Triggers are completely disabled in standalone mode so as not to
+ 	 * prevent fixing a problematic situation.
+ 	 *
+ 	 * To enable Event Triggers in standalone mode we would have to stop using
+ 	 * systable_beginscan_ordered so that it's still possible to rebuild
+ 	 * corrupt indexes (thanks to ignore_system_indexes). One way to do that is
+ 	 * implementing a heapscan-and-sort code path to use when
+ 	 * ignore_system_indexes is set.
+ 	 */
+ 	if (!IsUnderPostmaster)
+ 		return;
+ 
+ 	/*
  	 * We want the list of command tags for which this procedure is actually
  	 * invoked to match up exactly with the list that CREATE EVENT TRIGGER
  	 * accepts.  This debugging cross-check will throw an error if this