pgsql: Support json_errdetail in FRONTEND code

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Support json_errdetail in FRONTEND code
Date: 2024-03-17 23:03:35
Message-ID: E1rlzXS-004LYx-LF@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Support json_errdetail in FRONTEND code

Allocate memory for the error message inside memory owned by the
JsonLexContext and move responsibility away from the caller for
freeing it. This means that we can partially revert b44669b2ca
as this is now safe to use in FRONTEND code. The motivation for
this comes from the OAuth and incremental JSON patchsets but it
also adds value on its own.

Author: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/CAOYmi+mWdTd6ujtyF7MsvXvk7ToLRVG_tYAcaGbQLvf=N4KrQw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d6607016c738a5ccdd9422f3c11778903a03cdbb

Modified Files
--------------
src/bin/pg_verifybackup/t/005_bad_manifest.pl | 3 +-
src/common/jsonapi.c | 121 +++++++++++++++-----------
src/common/parse_manifest.c | 2 +-
src/include/common/jsonapi.h | 1 +
4 files changed, 73 insertions(+), 54 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2024-03-18 01:17:41 pgsql: Initialize variables to placate compiler.
Previous Message Tom Lane 2024-03-17 21:54:51 pgsql: Mark hash_corrupted() as pg_attribute_noreturn.