Andres Freund <andres@anarazel.de> writes:
> On 2018-03-12 20:44:01 -0700, Peter Geoghegan wrote:
>> I wonder why DefineCustomStringVariable() does not set var->reset_val.
>> We see that within DefineCustomEnumVariable(),
>> DefineCustomRealVariable(), DefineCustomIntVariable(), etc.
> Peter, have you investigated this any further? This has been an open
> item for a while.
It looks to me like the "oversight" in DefineCustomStringVariable is
not really one; rather, the reset_val assignments in the sibling
routines are dead code. define_custom_variable will call
InitializeOneGUCOption which overwrites reset_val from the boot_val
in all cases. We should probably clean this up by removing the dead
assignments.
The WARNING seems to indicate that the error check in set_config_option
is too aggressive. I kind of wonder why it was placed there at all,
rather than in SQL-level operations like ExecSetVariableStmt.
regards, tom lane