Additional comments around need_escapes in pg_parse_json()

Started by Corey Huinkerover 1 year ago4 messageshackers
Jump to latest
#1Corey Huinker
corey.huinker@gmail.com

I recently had occasion to use the pg_parse_json() function for creating
input functions for pg_ndistinct and pg_dependencies.

While it is obvious now that I should have been parsing with
need_escapes=true, it wasn't obvious from the outset, and so I'm proposing
adding a few comments to help the next person come to that conclusion
sooner than I did.

Attachments:

v1-0001-Explain-impact-of-need_escapes-in-JSON-parsing.patchtext/x-patch; charset=US-ASCII; name=v1-0001-Explain-impact-of-need_escapes-in-JSON-parsing.patchDownload+17-2
#2Andrew Dunstan
andrew@dunslane.net
In reply to: Corey Huinker (#1)
Re: Additional comments around need_escapes in pg_parse_json()

On 2024-12-20 Fr 5:21 AM, Corey Huinker wrote:

I recently had occasion to use the pg_parse_json() function for
creating input functions for pg_ndistinct and pg_dependencies.

While it is obvious now that I should have been parsing with
need_escapes=true, it wasn't obvious from the outset, and so I'm
proposing adding a few comments to help the next person come to that
conclusion sooner than I did.

Comments are not quite accurate, but I'll look at cleaning them up and
adding them.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

#3Corey Huinker
corey.huinker@gmail.com
In reply to: Andrew Dunstan (#2)
Re: Additional comments around need_escapes in pg_parse_json()

Comments are not quite accurate, but I'll look at cleaning them up and
adding them.

Much appreciated. Also, I don't think we need all of the comments, but I
figured it was easier for me to comment at every possible good place, and
let you pick your favorites.

#4Andrew Dunstan
andrew@dunslane.net
In reply to: Corey Huinker (#3)
Re: Additional comments around need_escapes in pg_parse_json()

On 2024-12-23 Mo 2:15 AM, Corey Huinker wrote:

Comments are not quite accurate, but I'll look at cleaning them up
and
adding them.

Much appreciated. Also, I don't think we need all of the comments, but
I figured it was easier for me to comment at every possible good
place, and let you pick your favorites.

done.

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com