Re: Calling json_* functions with JSONB data

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Calling json_* functions with JSONB data
Дата
Msg-id CAKFQuwZazz+8YLueMV1p4+RzkaAmGyXyfV2xDjbdC8+hU6eEOQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Calling json_* functions with JSONB data  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Ответы Re: Calling json_* functions with JSONB data  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-hackers
On Mon, May 23, 2016 at 5:38 PM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
On 5/23/16 11:55 AM, Peter van Hardenberg wrote:
Fortunately, this seems quite easy to resolve by taking advantage of our
ability to add json_*(jsonb) form of the functions.

Another issue no one has mentioned is functions that return JSON/JSONB. IMO those should NOT be overloaded, because that will make it very easy to accidentally change from one type to the other without meaning to.

​Actually, by definition they cannot be overloaded.  A function's signature is derived from its input types only.


​"""
​The name of the new function must not match any existing function with the same input argument types in the same schema. However, functions of different argument types can share a name (this is called overloading).
"""

Admittedly the absence of "output" is not emphasized but overloading in (most?) languages (small sample size for personal knowledge) is subject to the same restriction.

David J.
 

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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: Calling json_* functions with JSONB data
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: [BUGS] BUG #14153: Unrecognized node type error when upsert is present in recursive CTE