<div dir="ltr"><span style="font-size:12.8px">Overview</span><div>------------<br>Currently pgpool-II only supports global configuration parameters and their value can only be set through pgpool.conf file. This system has few limitations.<div><br></div><div>-- Since the configuration parameter scope is global so it is not possible to have a changed parameter value for a particular user session. <div><br></div><div>-- Changing the value of a configuration parameter is not very simple. Since the only way currently available is to change the parameter value in the configuration file and then reload it. </div><div>Setting the value of a configuration parameter </div><div><br><div><span style="font-size:12.8px">This proposal seeks a enhancements to pgpool configuration systems for </span><span style="font-size:12.8px">providing a way to alter the value of certain configuration parameters for a user session. More specific the proposal is for making the pgpool configuration system work like G</span>UC (Grand Unified Configuration) of PostgreSQL.</div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Which config parameter can be changed in the session.</span><span style="font-size:12.8px"><br></span></div><div>--------------------------------------------</div><div>Currently pgpool-II has two types of configuration parameters. One that can only be set at startup, and changing its value requires a pgpool-II restart. While, others are a little more flexible and can be changed by reloading the pgpool-II configuration file. This new configuration system will add another type for the configuration parameters, The variables belonging to that type can also be changed by session user and will not require pgpool-II restart. The scope of these variables will not be global means different sessions can have different values of the same variable at any time. </div><div><br></div><div>Security</div><div>-------------</div><div>There will be no individual setting for each configuration parameter to allow or disallow it being changed for a session, and we will provide new boolean pgpool config parameter &quot;<i>allow_set_command&quot;</i> which will enable/disable the session level config parameters setting. And this new <i>allow_set_command </i>can only be changed from pgpool config file.</div><div><br></div><div><br></div><div><span style="font-size:12.8px">Syntax</span></div><div>--------------</div><div><span style="font-size:12.8px">We will use the PostgreSQL&#39;s SET command syntax, used to alter the value of a PostgreSQL GUC variable.</span></div><div><span style="font-size:12.8px"><font face="monospace, monospace"><br></font></span></div><div><span style="font-size:12.8px"><font face="monospace, monospace">SET</font><font face="monospace, monospace"> configuration_parameter TO value;</font></span></div><div><span style="font-size:12.8px"><font face="monospace, monospace"><br></font></span></div><div><span style="font-size:12.8px">But since this SET command is used by PostgreSQL clients to change the PostgreSQL&#39;s GUC so we will use &quot;<i>pool_&quot;</i> prefix for setting the pgpool-II configuration parameters.</span></div><div><div><span style="font-size:12.8px"><font face="monospace, monospace"><br></font></span></div><div><span style="font-size:12.8px"><font face="monospace, monospace">SET</font><font face="monospace, monospace"> <b>pool_</b>configuration_parameter TO value;</font></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">This pool_ prefix will only be required when changing the parameter value using the SET command and pgpool.conf will keep using the same existing configuration parameter names. For example, to change the value pgpool-II&#39;s <i>client_min_message</i> value we will issue the following SET command</span><br></div></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">-&gt; SET pool_</span><span style="font-size:12.8px">client_min_message TO default;</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">What will happen to the configuration parameters changed in the session during reload config.</span></div><div>------------------------------------------------------------------<br style="font-size:12.8px"></div><div><br></div><div><span style="font-size:12.8px">Reload config will not change the value of variable changed by the user in the session, but the once the user session disconnects the variable will be reset to new reloaded value.</span></div><div><br></div><div><span style="font-size:12.8px">Overview of what is needed to be done in the code for this task:</span></div>------------------------------------------------------------------</div><div><div><br></div><div>-- Enhance the configuration scanner so that we do not require a separate if statement for each configuration parameter in the &quot;pool_config.l&quot; file. This will require a comprehensive POOL_CONFIG structure that will contain all the information regarding the configuration parameter including its context, default value and config name.</div><div><br></div><div>-- Define a new config context in the config scanner for the variables which can be changed by the SET command.</div><div><br></div><div>-- Add the mechanism to reset the configuration parameters to their original value after user session disconnects. So that the configuration parameter value changed in one user session should not affect the other user&#39;s session served by the same child process.</div><div><br></div><div>--  Add new <i>allow_set_command </i>parameter as described above.</div><div><br></div><div><br></div><div><span style="font-size:12.8px">Comments, opinions?</span><br></div></div></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Regards</span></div><div><span style="font-size:12.8px">Muhammad Usama</span></div><div><span style="font-size:12.8px"><br></span></div></div></div>