99 *
1010 *
1111 * IDENTIFICATION
12- * $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.48 2001/05/08 21:06:42 petere Exp $
12+ * $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.49 2001/06/07 04:50:56 momjian Exp $
1313 *
1414 *-------------------------------------------------------------------------
1515 */
3939#endif
4040
4141
42- static bool show_date (void );
43- static bool reset_date (void );
44- static bool parse_date (char * );
42+ static bool show_datestyle (void );
43+ static bool reset_datestyle (void );
44+ static bool parse_datestyle (char * );
4545static bool show_timezone (void );
4646static bool reset_timezone (void );
4747static bool parse_timezone (char * );
@@ -192,15 +192,15 @@ static intDefaultDateStyle;
192192static bool DefaultEuroDates ;
193193
194194static bool
195- parse_date (char * value )
195+ parse_datestyle (char * value )
196196{
197197char * tok ;
198198int dcnt = 0 ,
199199ecnt = 0 ;
200200
201201if (value == NULL )
202202{
203- reset_date ();
203+ reset_datestyle ();
204204return TRUE;
205205}
206206
@@ -261,7 +261,7 @@ parse_date(char *value)
261261}
262262
263263static bool
264- show_date (void )
264+ show_datestyle (void )
265265{
266266char buf [64 ];
267267
@@ -291,7 +291,7 @@ show_date(void)
291291}
292292
293293static bool
294- reset_date (void )
294+ reset_datestyle (void )
295295{
296296DateStyle = DefaultDateStyle ;
297297EuroDates = DefaultEuroDates ;
@@ -325,7 +325,7 @@ set_default_datestyle(void)
325325DBDate = strdup (DBDate );
326326
327327/* Parse desired setting into DateStyle/EuroDates */
328- parse_date (DBDate );
328+ parse_datestyle (DBDate );
329329
330330free (DBDate );
331331
@@ -396,7 +396,7 @@ show_timezone(void)
396396
397397tz = getenv ("TZ" );
398398
399- elog (NOTICE ,"Time zone is %s" , ((tz != NULL ) ?tz :"unknown " ));
399+ elog (NOTICE ,"Time zone is %s" , ((tz != NULL ) ?tz :"unset " ));
400400
401401return TRUE;
402402}/* show_timezone() */
@@ -586,7 +586,7 @@ parse_random_seed(char *value)
586586static bool
587587show_random_seed (void )
588588{
589- elog (NOTICE ,"Seed for random number generator isnot known " );
589+ elog (NOTICE ,"Seed for random number generator isunavailable " );
590590return (TRUE);
591591}
592592
@@ -708,7 +708,7 @@ SetPGVariable(const char *name, const char *value)
708708 * Special cases ought to be removed and handled separately by TCOP
709709 */
710710if (strcasecmp (name ,"datestyle" )== 0 )
711- parse_date (mvalue );
711+ parse_datestyle (mvalue );
712712else if (strcasecmp (name ,"timezone" )== 0 )
713713parse_timezone (mvalue );
714714else if (strcasecmp (name ,"DefaultXactIsoLevel" )== 0 )
@@ -724,18 +724,17 @@ SetPGVariable(const char *name, const char *value)
724724else if (strcasecmp (name ,"session_authorization" )== 0 )
725725SetSessionAuthorization (value );
726726else
727- SetConfigOption (name ,value ,superuser () ?PGC_SUSET :PGC_USERSET );
727+ SetConfigOption (name ,value ,superuser () ?PGC_SUSET :PGC_USERSET , false );
728728
729729if (mvalue )
730730pfree (mvalue );
731731}
732732
733-
734733void
735734GetPGVariable (const char * name )
736735{
737736if (strcasecmp (name ,"datestyle" )== 0 )
738- show_date ();
737+ show_datestyle ();
739738else if (strcasecmp (name ,"timezone" )== 0 )
740739show_timezone ();
741740else if (strcasecmp (name ,"DefaultXactIsoLevel" )== 0 )
@@ -748,7 +747,17 @@ GetPGVariable(const char *name)
748747show_server_encoding ();
749748else if (strcasecmp (name ,"seed" )== 0 )
750749show_random_seed ();
751- else
750+ else if (strcasecmp (name ,"all" )== 0 )
751+ {
752+ ShowAllGUCConfig ();
753+ show_datestyle ();
754+ show_timezone ();
755+ show_DefaultXactIsoLevel ();
756+ show_XactIsoLevel ();
757+ show_client_encoding ();
758+ show_server_encoding ();
759+ show_random_seed ();
760+ }else
752761{
753762const char * val = GetConfigOption (name );
754763
760769ResetPGVariable (const char * name )
761770{
762771if (strcasecmp (name ,"datestyle" )== 0 )
763- reset_date ();
772+ reset_datestyle ();
764773else if (strcasecmp (name ,"timezone" )== 0 )
765774reset_timezone ();
766775else if (strcasecmp (name ,"DefaultXactIsoLevel" )== 0 )
@@ -773,6 +782,17 @@ ResetPGVariable(const char *name)
773782reset_server_encoding ();
774783else if (strcasecmp (name ,"seed" )== 0 )
775784reset_random_seed ();
776- else
777- SetConfigOption (name ,NULL ,superuser () ?PGC_SUSET :PGC_USERSET );
785+ else if (strcasecmp (name ,"all" )== 0 )
786+ {
787+ reset_DefaultXactIsoLevel ();
788+ reset_XactIsoLevel ();
789+ reset_random_seed ();
790+ /* reset_server_encoding(); */
791+ reset_client_encoding ();
792+ reset_datestyle ();
793+ reset_timezone ();
794+
795+ ResetAllOptions ();
796+ }else
797+ SetConfigOption (name ,NULL ,superuser () ?PGC_SUSET :PGC_USERSET , false);
778798}