mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	worker_spi: Use term "dynamic" for bgworkers launched with worker_spi_launch()
This gives a way to make a difference between workers registered when the library is loaded with shared_preload_libraries and when these are launched dynamically, in ps output or pg_stat_activity. Extracted from a larger patch by the same author. Author: Bharath Rupireddy Reviewed-by: Masahiro Ikeda Discussion: https://postgr.es/m/CALj2ACWR9ncAiDF73unqdJF1dmsA2R0efGXX2624X+YVxcAVWg@mail.gmail.com
This commit is contained in:
		@@ -370,8 +370,8 @@ worker_spi_launch(PG_FUNCTION_ARGS)
 | 
			
		||||
	worker.bgw_restart_time = BGW_NEVER_RESTART;
 | 
			
		||||
	sprintf(worker.bgw_library_name, "worker_spi");
 | 
			
		||||
	sprintf(worker.bgw_function_name, "worker_spi_main");
 | 
			
		||||
	snprintf(worker.bgw_name, BGW_MAXLEN, "worker_spi worker %d", i);
 | 
			
		||||
	snprintf(worker.bgw_type, BGW_MAXLEN, "worker_spi");
 | 
			
		||||
	snprintf(worker.bgw_name, BGW_MAXLEN, "worker_spi dynamic worker %d", i);
 | 
			
		||||
	snprintf(worker.bgw_type, BGW_MAXLEN, "worker_spi dynamic");
 | 
			
		||||
	worker.bgw_main_arg = Int32GetDatum(i);
 | 
			
		||||
	/* set bgw_notify_pid so that we can use WaitForBackgroundWorkerStartup */
 | 
			
		||||
	worker.bgw_notify_pid = MyProcPid;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user