Re: format_datum debugging function

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: format_datum debugging function
Date: 2024-08-15 07:50:15
Message-ID: 4f87171d-1623-4acf-8d7e-80a714ae68ea@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14.08.24 17:46, Paul Jungwirth wrote:
> On 8/14/24 02:16, Peter Eisentraut wrote:
>> On 12.08.24 23:15, Paul Jungwirth wrote:
>>> On 8/12/24 04:32, Aleksander Alekseev wrote:
>>>>> [...] This function takes a Datum and the appropriate out function,
>>>>> and returns a char *. So you
>>>>> can do this:
>>>>>
>>>>> (gdb) call format_datum(range_out, $1)
>>>>> $2 = 0x59162692d938 "[1,4)"
>>>>>
>>>>> I assume a patch like this doesn't need documentation. Does it need
>>>>> a test? Anything else?
>>>>
>>>> I think you forgot to attach the patch. Or is it just a proposal?
>>>
>>> Sorry, patch attached here.
>>
>> I don't think it's safe to call output functions at arbitrary points
>> from a debugger.  But if you're okay with that during development,
>> say, then I think you could just call
>> OidOutputFunctionCall(F_RANGE_OUT, $1)?
>
> I assumed it wasn't safe everywhere (e.g. there is potentially a TOAST
> lookup), but for debugging a patch that's okay with me.
>
> Are you doing something to get macro expansion? I've never gotten my gdb
> to see #defines, although in theory this configure line should do it,
> right?:

Oh I see, you don't have the F_* constants available then. Maybe just
put in the OID manually then?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2024-08-15 07:59:47 Re: Opinion poll: Sending an automated email to a thread when it gets added to the commitfest
Previous Message Jakub Wartak 2024-08-15 07:49:26 Re: Enable data checksums by default