Re: Calling json_* functions with JSONB data
От | Jim Nasby |
---|---|
Тема | Re: Calling json_* functions with JSONB data |
Дата | |
Msg-id | 1f8a6917-2421-34df-402c-ee6ad4a6ed63@BlueTreble.com обсуждение исходный текст |
Ответ на | Re: Calling json_* functions with JSONB data ("David G. Johnston" <david.g.johnston@gmail.com>) |
Список | pgsql-hackers |
On 5/23/16 4:45 PM, David G. Johnston wrote: > On Mon, May 23, 2016 at 5:38 PM, Jim Nasby <Jim.Nasby@bluetreble.com > <mailto: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. My point is that while it would be possible to create something like json_strip_nulls(jsonb) to go with json_strip_nulls(json), that would be a bad idea, because it makes it easily to accidentally turn your jsonb into plain json. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com 855-TREBLE2 (855-873-2532) mobile: 512-569-9461
В списке pgsql-hackers по дате отправления: