Re: current_setting returns 'unset'

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: current_setting returns 'unset'
Date: 2006-01-10 15:01:36
Message-ID: 29515.1136905296@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2006-01-10 15:23:46 Re: current_setting returns 'unset'
Previous Message Tom Lane 2006-01-10 14:47:50 Re: lookup_rowtype_tupdesc considered harmful