Re: [PATCH] Make jsonapi usable from libpq
Jacob Champion <pchampion@vmware.com>
From: Jacob Champion <pchampion@vmware.com>
To: "michael@paquier.xyz" <michael@paquier.xyz>, "tgl@sss.pgh.pa.us" <tgl@sss.pgh.pa.us>
Cc: "daniel@yesql.se" <daniel@yesql.se>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2021-06-29T18:09:43Z
Lists: pgsql-hackers
On Sun, 2021-06-27 at 10:43 +0900, Michael Paquier wrote: > On Sat, Jun 26, 2021 at 01:43:50PM -0400, Tom Lane wrote: > > BTW, so far as the original topic of this thread is concerned, > > it sounds like Jacob's ultimate goal is to put some functionality > > into libpq that requires JSON parsing. I'm going to say up front > > that that sounds like a terrible idea. As we've just seen, libpq > > operates under very tight constraints, not all of which are > > mechanically enforced. I am really doubtful that anything that > > would require a JSON parser has any business being in libpq. > > Unless you can sell us on that point, I do not think it's worth > > complicating the src/common JSON code to the point where it can > > work under libpq's constraints. > > AFAIK, the SASL mechanism OAUTHBEARER described in RFC 7628 would > require such facilities as failures are reported in this format: > https://datatracker.ietf.org/doc/html/rfc7628 Right. So it really comes down to whether or not OAUTHBEARER support is worth this additional complication, and that probably belongs to the main thread on the topic. But hey, we're getting some code cleanup out of the deal either way. > Perhaps you are right and we have no need to do any json parsing in > libpq as long as we pass down the JSON blob, but I am not completely > sure if we can avoid that either. It is definitely an option. With the current architecture of the proof-of-concept, I feel like forcing every client to implement JSON parsing just to be able to use OAUTHBEARER would be a significant barrier to entry. Again, that's probably conversation for the main thread. > Separate topic: I find disturbing the dependency of jsonapi.c to > the logging parts just to cope with dummy error values that are > originally part of JsonParseErrorType. I think we should clean this up regardless. --Jacob
Commits
-
Remove libpq's use of abort(3) to handle mutex failure cases.
- aaddf6ba09e2 15.0 landed
-
Don't use abort(3) in libpq's fe-print.c.
- cf1f545bf281 14.0 landed
- b54be47cdc2d 9.6.23 landed
- 34c24e5a4337 11.13 landed
- 240d56fc4351 12.8 landed
- 1603deca34ef 13.4 landed
- 06a2b2fe5580 10.18 landed
- 6f5d9bce57a7 15.0 landed
-
Remove undesirable libpq dependency on stringinfo.c.
- 8ec00dc5cd70 14.0 landed
-
Remove arbitrary line length limit for libpq service files.
- c0cb87fbb664 14.0 cited
-
Use abort() instead of exit() to abort library functions
- c6ea8ccea6bf 9.2.0 cited