missing entry in GucSource_Names

Started by Jeff Davisover 16 years ago2 messages
#1Jeff Davis
pgsql@j-davis.com
1 attachment(s)

It appears that the patch here:

http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=a30fa4ca33d055c46bebc0e5c701d5b4fd27814d

missed adding PGC_S_DATABASE_USER to a few locations, most notably
GucSource_Names, where the PGC_S_SESSION now points off the end of the
array.

Patch attached.

Regards,
Jeff Davis

Attachments:

database-user.patchtext/x-patch; charset=UTF-8; name=database-user.patchDownload
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 1f63e06..776efe3 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -460,6 +460,7 @@ const char *const GucSource_Names[] =
 	 /* PGC_S_ARGV */ "command line",
 	 /* PGC_S_DATABASE */ "database",
 	 /* PGC_S_USER */ "user",
+	 /* PGC_S_DATABASE_USER */ "database user",
 	 /* PGC_S_CLIENT */ "client",
 	 /* PGC_S_OVERRIDE */ "override",
 	 /* PGC_S_INTERACTIVE */ "interactive",
@@ -4556,7 +4557,8 @@ set_config_option(const char *name, const char *value,
 		 */
 		elevel = IsUnderPostmaster ? DEBUG3 : LOG;
 	}
-	else if (source == PGC_S_DATABASE || source == PGC_S_USER)
+	else if (source == PGC_S_DATABASE || source == PGC_S_USER ||
+			 source == PGC_S_DATABASE_USER)
 		elevel = WARNING;
 	else
 		elevel = ERROR;
@@ -5762,6 +5764,7 @@ define_custom_variable(struct config_generic * variable)
 			break;
 		case PGC_S_DATABASE:
 		case PGC_S_USER:
+		case PGC_S_DATABASE_USER:
 		case PGC_S_CLIENT:
 		case PGC_S_SESSION:
 		default:
#2Alvaro Herrera
alvherre@commandprompt.com
In reply to: Jeff Davis (#1)
Re: missing entry in GucSource_Names

Jeff Davis wrote:

It appears that the patch here:

http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=a30fa4ca33d055c46bebc0e5c701d5b4fd27814d

missed adding PGC_S_DATABASE_USER to a few locations, most notably
GucSource_Names, where the PGC_S_SESSION now points off the end of the
array.

Woops! applied, thanks.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.