Re: [PATCH] Make jsonapi usable from libpq
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Jacob Champion <pchampion@vmware.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Daniel Gustafsson <daniel@yesql.se>
Date: 2021-06-28T19:15:47Z
Lists: pgsql-hackers
I wrote: >> Not real sure what to do about PGTHREAD_ERROR. > I wonder if we shouldn't simply nuke that macro and change the > call sites into "Assert(false)". After further study this still seems like the best available choice. We do not have the option to make either default_threadlock() or pq_lockingcallback() do something saner, like return a failure indication. pq_lockingcallback()'s API is dictated by OpenSSL, while default_threadlock()'s API is exposed to users by libpq (IOW, we could have gotten that one right years ago, but we failed to, and it seems much too late to change it now). Also, I trawled the mailing list archives, and I can find no indication that any of the PGTHREAD_ERROR messages have ever been seen in the field. The last relevant discussion seems to be in https://www.postgresql.org/message-id/flat/20130801142443.GO2706%40tamriel.snowman.net where it was observed that this code isn't very well thought through :-( My proposal is to replace PGTHREAD_ERROR by Assert(false) in HEAD, but leave things alone in the back branches. As far as the other patch to check for mistakes with "nm" goes, we could either do nothing in the back branches, or install a check for "exit" only, not "abort". But there's probably no real need for such a check in the back branches as long as we're enforcing it in HEAD. regards, tom lane
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