Re: current_setting returns 'unset' - Mailing list pgsql-hackers

From Tom Lane
Subject Re: current_setting returns 'unset'
Date
Msg-id 29515.1136905296@sss.pgh.pa.us
Whole thread Raw
In response to current_setting returns 'unset'  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: current_setting returns 'unset'
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> The function current_setting returns 'unset' if a parameter is not set.  
> Should it not return null?  This is not documented, so I guess this just 
> arose out of the implementation, or is this intentional?

That's because SHOW does the same thing.  SHOW has a little problem in
that it can't readily show the difference between "null" and an empty
string, so while I find the behavior pretty ugly, I don't have a better
idea.

The question thus is do you want the function behaving differently from
SHOW.  Returning NULL is probably better from a programming point of
view, but it'd be inconsistent with the command.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: lookup_rowtype_tupdesc considered harmful
Next
From: Neil Conway
Date:
Subject: Re: lookup_rowtype_tupdesc considered harmful