Re: [PATCH] two-arg current_setting() with fallback

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [PATCH] two-arg current_setting() with fallback
Дата
Msg-id CA+TgmoaZqxEhQ2xx7N5+LMdoKSTp3NHScFZButqd-Q5Rd8oCgg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] two-arg current_setting() with fallback  (David Christensen <david@endpoint.com>)
Ответы Re: [PATCH] two-arg current_setting() with fallback  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
On Fri, Mar 20, 2015 at 10:54 AM, David Christensen <david@endpoint.com> wrote:
> In that case, the other thought I had here is that we change the function signature of current_setting() to be a
two-argform where the second argument is a boolean "throw_error", with a default argument of true to preserve existing
semantics,and returning NULL if that argument is false.  However, I'm not sure if there are some issues with changing
thesignature of an existing function (e.g., with pg_upgrade, etc.). 
>
> My *impression* is that since pg_upgrade rebuilds the system tables for a new install it shouldn't be an issue, but
notsure if having the same pg_proc OID with different values or an alternate pg_proc OID would cause issues down the
line;anyone know if this is a dead-end? 

I think if the second argument is defaulted it would be OK.  However
it might make sense to instead add a new two-argument function and
leave the existing one-argument function alone, because setting
default arguments for functions defined in pg_proc.h is kind of a
chore.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: proposal: doc: simplify examples of dynamic SQL
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: [PATCH] two-arg current_setting() with fallback