Re: Add pg_settings.pending_restart column - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Add pg_settings.pending_restart column
Date
Msg-id 54F7C7C2.7030705@gmx.net
Whole thread Raw
In response to Re: Add pg_settings.pending_restart column  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Add pg_settings.pending_restart column
List pgsql-hackers
On 2/17/15 10:45 AM, Robert Haas wrote:
> You don't really need the "else" here, and in parallel cases:
> 
>                      if (*conf->variable != newval)
>                      {
> +                        record->status |= GUC_PENDING_RESTART;
>                          ereport(elevel,
>                                  (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),
>                                   errmsg("parameter \"%s\" cannot be
> changed without restarting the server",
>                                          name)));
>                          return 0;
>                      }
> +                    else
> +                        record->status &= ~GUC_PENDING_RESTART;
>                      return -1;
> 
> The if-statement ends with "return 0" so there is no reason for the "else".

I kind of liked the symmetry of if/else, but I can change it.





pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: CATUPDATE confusion?
Next
From: Peter Eisentraut
Date:
Subject: Re: Add pg_settings.pending_restart column