Re: Support json_errdetail in FRONTEND builds

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz>, Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support json_errdetail in FRONTEND builds
Date: 2024-03-15 09:03:54
Message-ID: 178BA01F-910E-49B4-8F56-49BF879EC0B0@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 15 Mar 2024, at 09:38, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>
> On 2024-Mar-14, Tom Lane wrote:
>
>> Michael Paquier <michael(at)paquier(dot)xyz> writes:
>>> Hmm. I am not sure how much protection this would offer, TBH. One
>>> thing that I find annoying with common/stringinfo.c as it is currently
>>> is that we have two exit() calls in the enlarge path, and it does not
>>> seem wise to me to spread that even more.
>
>> I hope nobody is expecting that such code will get accepted. We have
>> a policy (and an enforcement mechanism) that libpq.so must not call
>> exit(). OAuth code in libpq will need to cope with using pqexpbuffer.
>
> FWIW that's exactly what Jacob's OAUTH patch does -- it teaches the
> relevant JSON parser code to use pqexpbuffer when in frontend
> environment, and continues to use StringInfo in backend. I find that a
> bit cumbersome, but if the idea of changing the StringInfo behavior
> (avoiding exit()) is too radical, then perhaps it's better that we go
> with Jacob's proposal in the other thread:

Correct, the OAuth work does not make any claims to use StringInfo in libpq.
My understanding of this thread was to make it use StringInfo for now to get
this available for frontend binaries now, and reduce scope here, and later
change it up if/when the OAuth patch lands.

--
Daniel Gustafsson

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-03-15 09:23:31 Re: Weird test mixup
Previous Message Alvaro Herrera 2024-03-15 08:38:19 Re: Support json_errdetail in FRONTEND builds