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

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: [HACKERS] [PATCH] Add two-arg for of current_setting(NAME,FALLBACK)
Дата
Msg-id 17496ef9-4e3e-4e5b-1514-5406f5a41da2@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: [HACKERS] [PATCH] Add two-arg for of current_setting(NAME,FALLBACK)  (Nico Williams <nico@cryptonector.com>)
Список 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 по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] list of credits for release notes
Следующее
От: David Fetter
Дата:
Сообщение: Re: [HACKERS] Client Connection redirection support for PostgreSQL