Re: [HACKERS] [PATCH] Add two-arg for of current_setting(NAME, FALLBACK) - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: [HACKERS] [PATCH] Add two-arg for of current_setting(NAME, FALLBACK)
Date
Msg-id CAKFQuwazKj9bTbc+viqK_xeCs8a_=_54JHabAG14UAYZvWLjCA@mail.gmail.com
Whole thread Raw
In response to [HACKERS] [PATCH] Add two-arg for of current_setting(NAME, FALLBACK)  (David Christensen <david@endpoint.com>)
List pgsql-hackers
On Thu, Mar 19, 2015 at 3:41 PM, David Christensen <david@endpoint.com> wrote:
The two-arg form of the current_setting() function will allow a
fallback value to be returned instead of throwing an error when an
unknown GUC is provided.  This would come in most useful when using
custom GUCs; e.g.:

  -- returns current setting of foo.bar, or 'default' if not set
  SELECT current_setting('foo.bar', 'default')

​This doesn't actually change the GUC in the system, right?  Do we want a side-effect version of this?

There is already a two-arg form where the second argument is a boolean - there needs to be tests that ensure proper behavior and function lookup resolution.

No docs.

David J.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] ALTER COLUMN TYPE vs. domain constraints
Next
From: Nico Williams
Date:
Subject: Re: [HACKERS] [PATCH] Add two-arg for of current_setting(NAME,FALLBACK)