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

From Peter Eisentraut
Subject Re: [HACKERS] [PATCH] Add two-arg for of current_setting(NAME,FALLBACK)
Date
Msg-id 17496ef9-4e3e-4e5b-1514-5406f5a41da2@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] [PATCH] Add two-arg for of current_setting(NAME,FALLBACK)  (Nico Williams <nico@cryptonector.com>)
List pgsql-hackers
On 11/1/17 14:02, Nico Williams wrote:
> There already _is_ a two-argument form of current_setting() that yours
> somewhat conflicts with:
> 
>    current_setting(setting_name [, missing_ok ])
> 
> https://www.postgresql.org/docs/current/static/functions-admin.html
> 
> I often use
> 
>   coalesce(current_setting(setting_name, true), default_value_here)
> 
> as an implementation of current_setting() with a default value.

That appears to address this use case then.  Do we need the new proposed
variant still?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] list of credits for release notes
Next
From: David Fetter
Date:
Subject: Re: [HACKERS] Client Connection redirection support for PostgreSQL