common/jsonapi: support libpq as a client

Peter Eisentraut <peter@eisentraut.org>

Commit: 0785d1b8b2fa27074eeb18a3ac1f2a0e76cb8339
Author: Peter Eisentraut <peter@eisentraut.org>
Date: 2024-09-11T07:01:07Z
Releases: 18.0
common/jsonapi: support libpq as a client

Based on a patch by Michael Paquier.

For libpq, use PQExpBuffer instead of StringInfo. This requires us to
track allocation failures so that we can return JSON_OUT_OF_MEMORY as
needed rather than exit()ing.

Author: Jacob Champion <jacob.champion@enterprisedb.com>
Co-authored-by: Michael Paquier <michael@paquier.xyz>
Co-authored-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/d1b467a78e0e36ed85a09adf979d04cf124a9d4b.camel@vmware.com

Files

Discussion