Thread: What default is - SET behavior

What default is - SET behavior

From
Zdenek Kotala
Date:
I'm interesting in problem "Allow commenting of variables in postgresql.conf to restore them to defaults".  And I need
someclarify of SET command behavior.<br /><br /> Res_value is defined  in the source code as highest overriding setting
duringstartup (or reconfiguration) and it is used for store "default" value. Hovewer documentation of SET command (<a
class="moz-txt-link-freetext"
href="http://www.postgresql.org/docs/8.1/interactive/sql-set.html">http://www.postgresql.org/docs/8.1/interactive/sql-set.html</a>)
talkabout "<tt class="LITERAL"><span id="__firefox-findbar-search-id" style="padding: 0pt; background-color: yellow;
color:black; display: inline; font-size: inherit;">DEFAULT</span></tt> can be used to specify resetting the parameter
toits <span id="__firefox-findbar-search-id" style="padding: 0pt; background-color: yellow; color: black; display:
inline;font-size: inherit;">default</span> value." And there is question what is the meaning of "default value". 
BecauseI understood "default" like value coded in source code - mentioned in the postgresql.conf.  <br /><br /><br />
ThanksZdenek<br /> 

Re: What default is - SET behavior

From
Bruce Momjian
Date:
Zdenek Kotala wrote:
> I'm interesting in problem "Allow commenting of variables in 
> postgresql.conf to restore them to defaults".  And I need some clarify 
> of SET command behavior.
> 
> Res_value is defined  in the source code as highest overriding setting 
> during startup (or reconfiguration) and it is used for store "default" 
> value. Hovewer documentation of SET command 
> (http://www.postgresql.org/docs/8.1/interactive/sql-set.html) talk about 
> "DEFAULT can be used to specify resetting the parameter to its default 
> value." And there is question what is the meaning of "default value".  
> Because I understood "default" like value coded in source code - 
> mentioned in the postgresql.conf. 

DEFAULT in this case is session default, which might be the compiled in
default, which can be over-ridden by postgresql.conf, or by a user user
SET command on session start (ALTER USER SET).

--  Bruce Momjian   http://candle.pha.pa.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


Re: What default is - SET behavior

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Zdenek Kotala wrote:
>> I'm interesting in problem "Allow commenting of variables in 
>> postgresql.conf to restore them to defaults".  And I need some clarify 
>> of SET command behavior.

> DEFAULT in this case is session default, which might be the compiled in
> default, which can be over-ridden by postgresql.conf, or by a user user
> SET command on session start (ALTER USER SET).

More specifically, RESET and SET TO DEFAULT both have the behavior of
establishing whatever value would now prevail if you had never issued
any interactive SET in the current session.  This might in fact be
different from any value that actually had prevailed earlier in the
session --- for instance if the new value comes from a postgresql.conf
entry that's been changed since you did your SET.
        regards, tom lane