@@ -3718,7 +3718,7 @@ process_postgres_switches(int argc, char *argv[], GucContext ctx,
3718
3718
* postmaster/postmaster.c (the option sets should not conflict) and with
3719
3719
* the common help() function in main/main.c.
3720
3720
*/
3721
- while ((flag = getopt (argc , argv , "B:bc:C :D:d:EeFf:h:ijk:lN:nOPp:r:S:sTt:v:W:-:" )) != -1 )
3721
+ while ((flag = getopt (argc , argv , "B:bC:c :D:d:EeFf:h:ijk:lN:nOPp:r:S:sTt:v:W:-:" )) != -1 )
3722
3722
{
3723
3723
switch (flag )
3724
3724
{
@@ -3736,6 +3736,32 @@ process_postgres_switches(int argc, char *argv[], GucContext ctx,
3736
3736
/* ignored for consistency with the postmaster */
3737
3737
break ;
3738
3738
3739
+ case 'c' :
3740
+ case '-' :
3741
+ {
3742
+ char * name ,
3743
+ * value ;
3744
+
3745
+ ParseLongOption (optarg , & name , & value );
3746
+ if (!value )
3747
+ {
3748
+ if (flag == '-' )
3749
+ ereport (ERROR ,
3750
+ (errcode (ERRCODE_SYNTAX_ERROR ),
3751
+ errmsg ("--%s requires a value" ,
3752
+ optarg )));
3753
+ else
3754
+ ereport (ERROR ,
3755
+ (errcode (ERRCODE_SYNTAX_ERROR ),
3756
+ errmsg ("-c %s requires a value" ,
3757
+ optarg )));
3758
+ }
3759
+ SetConfigOption (name , value , ctx , gucsource );
3760
+ pfree (name );
3761
+ pfree (value );
3762
+ break ;
3763
+ }
3764
+
3739
3765
case 'D' :
3740
3766
if (secure )
3741
3767
userDoption = strdup (optarg );
@@ -3850,32 +3876,6 @@ process_postgres_switches(int argc, char *argv[], GucContext ctx,
3850
3876
SetConfigOption ("post_auth_delay" , optarg , ctx , gucsource );
3851
3877
break ;
3852
3878
3853
- case 'c' :
3854
- case '-' :
3855
- {
3856
- char * name ,
3857
- * value ;
3858
-
3859
- ParseLongOption (optarg , & name , & value );
3860
- if (!value )
3861
- {
3862
- if (flag == '-' )
3863
- ereport (ERROR ,
3864
- (errcode (ERRCODE_SYNTAX_ERROR ),
3865
- errmsg ("--%s requires a value" ,
3866
- optarg )));
3867
- else
3868
- ereport (ERROR ,
3869
- (errcode (ERRCODE_SYNTAX_ERROR ),
3870
- errmsg ("-c %s requires a value" ,
3871
- optarg )));
3872
- }
3873
- SetConfigOption (name , value , ctx , gucsource );
3874
- pfree (name );
3875
- pfree (value );
3876
- break ;
3877
- }
3878
-
3879
3879
default :
3880
3880
errs ++ ;
3881
3881
break ;
0 commit comments