Calling json_* functions with JSONB data - Mailing list pgsql-hackers

From Peter van Hardenberg
Subject Calling json_* functions with JSONB data
Date
Msg-id CABTbUpgQ3b-JTNUaLPLGL3aw4V9LtwFnbLuHhA9-BTVyGcggNQ@mail.gmail.com
Whole thread Raw
Responses Re: Calling json_* functions with JSONB data  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: Calling json_* functions with JSONB data  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Calling json_* functions with JSONB data  (Marko Tiikkaja <marko@joh.to>)
Re: Calling json_* functions with JSONB data  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers
Hi there,

I noticed it was very easy to accidentally call the json_* form of JSON manipulation functions with jsonb data as input. This is pretty sub-optimal, since it involves rendering the jsonb then reparsing it and calling the json_* form of the function.

Fortunately, this seems quite easy to resolve by taking advantage of our ability to add json_*(jsonb) form of the functions.

I talked this over with Andrew who had no objections and suggested I float it on the list before writing a patch. Looks pretty straightforward, just a few new data rows in pg_proc.h.

Anyone have any concerns or suggestions?

-p

--
Peter van Hardenberg
San Francisco, California
"Everything was beautiful, and nothing hurt."—Kurt Vonnegut

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Parallel safety tagging of extension functions
Next
From: Tom Lane
Date:
Subject: Re: Changed SRF in targetlist handling