On Mon, 2003-07-28 at 10:57, Tom Lane wrote:
> Good idea.  Please send a patch that exports the guc.c array for use in
> the other file.  I'd lean towards the lower-cased spellings, though I'm
> not strong about it.  (I'd also not use a dash in "super-user".)

I've attached the patch below. It modifies help_config.c to use the new
GucContextName array from guc.c

It also changes 'super-user' to 'superuser'

I was waiting for Joe's earlier patch to be applied, this should be safe
to apply now.

Thanks,
Aizaz
Index: backend/utils/misc/guc.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/misc/guc.c,v
retrieving revision 1.142
diff -c -p -r1.142 guc.c
*** backend/utils/misc/guc.c	28 Jul 2003 16:22:02 -0000	1.142
--- backend/utils/misc/guc.c	28 Jul 2003 18:01:38 -0000
*************** static char *config_type_name[] = 
*** 169,181 ****
  /*
   * Used for pg_settings. Keep in sync with GucContext enum in guc.h
   */
! static char *GucContextName[] = 
  {
  	"internal",
  	"postmaster",
  	"sighup",
  	"backend",
! 	"super-user",
  	"userlimit",
  	"user"
  };
--- 169,181 ----
  /*
   * Used for pg_settings. Keep in sync with GucContext enum in guc.h
   */
! char *GucContextName[] = 
  {
  	"internal",
  	"postmaster",
  	"sighup",
  	"backend",
! 	"superuser",
  	"userlimit",
  	"user"
  };
Index: backend/utils/misc/help_config.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/misc/help_config.c,v
retrieving revision 1.2
diff -c -p -r1.2 help_config.c
*** backend/utils/misc/help_config.c	9 Jul 2003 17:57:47 -0000	1.2
--- backend/utils/misc/help_config.c	28 Jul 2003 18:01:38 -0000
*************** static bool displayStruct(mixedStruct * 
*** 135,151 ****
  /*
   * This array contains the display names for each of the GucContexts available
   *
-  * Note: these strings are deliberately not localized.
   */
! static const char *const GucContext_names[] = {
! 	"INTERNAL",
! 	"POSTMASTER",
! 	"SIGHUP",
! 	"BACKEND",
! 	"SUSET",
! 	"USERLIMIT",
! 	"USERSET"
! };
  
  /*
   * Reads in the the command line options and sets the state of the program
--- 135,142 ----
  /*
   * This array contains the display names for each of the GucContexts available
   *
   */
! extern char * GucContextName[];
  
  /*
   * Reads in the the command line options and sets the state of the program
*************** printGenericHead(struct config_generic s
*** 406,412 ****
  {
  	printf(gettext(GENERIC_FORMAT[outFormat]),
  		   structToPrint.name,
! 		   GucContext_names[structToPrint.context],
  		   gettext(config_group_names[structToPrint.group]));
  }
  
--- 397,403 ----
  {
  	printf(gettext(GENERIC_FORMAT[outFormat]),
  		   structToPrint.name,
! 		   GucContextName[structToPrint.context],
  		   gettext(config_group_names[structToPrint.group]));
  }
  
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to