From 57be007a32e0963db003a5ac9ca3cfbc0deef974 Mon Sep 17 00:00:00 2001
From: Wolfgang Walther <walther@technowledgy.de>
Date: Mon, 25 Mar 2024 22:21:10 +0100
Subject: [PATCH 5/5] Remove obsolete way of disabling ps status

This can be committed once it's clear that nobody actually needs it.
---
 src/backend/utils/misc/ps_status.c | 30 ------------------------------
 1 file changed, 30 deletions(-)

diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c
index d1df1b39ee0..5d61259cc22 100644
--- a/src/backend/utils/misc/ps_status.c
+++ b/src/backend/utils/misc/ps_status.c
@@ -40,12 +40,7 @@ bool		update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;
  * PS_USE_CLOBBER_ARGV
  *	   write over the argv area
  *	   (This is the default)
- * PS_USE_NONE
- *	   don't update ps display
- *	   (This can be enabled manually with CPPFLAGS=-DPS_USE_NONE.)
  */
-#ifndef PS_USE_NONE
-
 #if defined(HAVE_SETPROCTITLE_FAST)
 #define PS_USE_SETPROCTITLE_FAST
 #elif defined(HAVE_SETPROCTITLE)
@@ -56,8 +51,6 @@ bool		update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;
 #define PS_USE_CLOBBER_ARGV
 #endif
 
-#endif							/* not PS_USE_NONE */
-
 /* Different systems want the buffer padded differently */
 #if defined(__linux__) || defined(__darwin__)
 #define PS_PADDING '\0'
@@ -66,8 +59,6 @@ bool		update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;
 #endif
 
 
-#ifndef PS_USE_NONE
-
 #ifndef PS_USE_CLOBBER_ARGV
 /* all but one option need a buffer to write their ps line in */
 #define PS_BUFFER_SIZE 256
@@ -92,8 +83,6 @@ static size_t ps_buffer_nosuffix_len;
 
 static void flush_ps_display(void);
 
-#endif							/* not PS_USE_NONE */
-
 /* save the original argv[] location here */
 static int	save_argc;
 static char **save_argv;
@@ -254,15 +243,12 @@ save_ps_display_args(int argc, char **argv)
 void
 init_ps_display(const char *fixed_part)
 {
-#ifndef PS_USE_NONE
 	bool		save_update_process_title;
-#endif
 
 	Assert(fixed_part || MyBackendType);
 	if (!fixed_part)
 		fixed_part = GetBackendTypeDesc(MyBackendType);
 
-#ifndef PS_USE_NONE
 	/* no ps display for stand-alone backend */
 	if (!IsUnderPostmaster)
 		return;
@@ -318,10 +304,8 @@ init_ps_display(const char *fixed_part)
 	update_process_title = true;
 	set_ps_display("");
 	update_process_title = save_update_process_title;
-#endif							/* not PS_USE_NONE */
 }
 
-#ifndef PS_USE_NONE
 /*
  * update_ps_display_precheck
  *		Helper function to determine if updating the process title is
@@ -346,7 +330,6 @@ update_ps_display_precheck(void)
 
 	return true;
 }
-#endif							/* not PS_USE_NONE */
 
 /*
  * set_ps_display_suffix
@@ -356,7 +339,6 @@ update_ps_display_precheck(void)
 void
 set_ps_display_suffix(const char *suffix)
 {
-#ifndef PS_USE_NONE
 	size_t		len;
 
 	/* first, check if we need to update the process title */
@@ -398,7 +380,6 @@ set_ps_display_suffix(const char *suffix)
 
 	/* and set the new title */
 	flush_ps_display();
-#endif							/* not PS_USE_NONE */
 }
 
 /*
@@ -408,7 +389,6 @@ set_ps_display_suffix(const char *suffix)
 void
 set_ps_display_remove_suffix(void)
 {
-#ifndef PS_USE_NONE
 	/* first, check if we need to update the process title */
 	if (!update_ps_display_precheck())
 		return;
@@ -426,7 +406,6 @@ set_ps_display_remove_suffix(void)
 
 	/* and set the new title */
 	flush_ps_display();
-#endif							/* not PS_USE_NONE */
 }
 
 /*
@@ -440,7 +419,6 @@ set_ps_display_with_len(const char *activity, size_t len)
 {
 	Assert(strlen(activity) == len);
 
-#ifndef PS_USE_NONE
 	/* first, check if we need to update the process title */
 	if (!update_ps_display_precheck())
 		return;
@@ -466,10 +444,8 @@ set_ps_display_with_len(const char *activity, size_t len)
 
 	/* Transmit new setting to kernel, if necessary */
 	flush_ps_display();
-#endif							/* not PS_USE_NONE */
 }
 
-#ifndef PS_USE_NONE
 static void
 flush_ps_display(void)
 {
@@ -506,7 +482,6 @@ flush_ps_display(void)
 	}
 #endif							/* PS_USE_WIN32 */
 }
-#endif							/* not PS_USE_NONE */
 
 /*
  * Returns what's currently in the ps display, in case someone needs
@@ -526,12 +501,7 @@ get_ps_display(int *displen)
 	}
 #endif
 
-#ifndef PS_USE_NONE
 	*displen = (int) (ps_buffer_cur_len - ps_buffer_fixed_size);
 
 	return ps_buffer + ps_buffer_fixed_size;
-#else
-	*displen = 0;
-	return "";
-#endif
 }
-- 
2.44.0

