Re: Use get_call_result_type() more widely - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Use get_call_result_type() more widely
Date
Msg-id 1125757.1671523899@sss.pgh.pa.us
Whole thread Raw
In response to Re: Use get_call_result_type() more widely  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Use get_call_result_type() more widely  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Mon, Dec 19, 2022 at 07:41:27PM +0530, Bharath Rupireddy wrote:
>> 0002 - gets rid of an unnecessary call to BlessTupleDesc()
>> after get_call_result_type().

> Hmm.  I am not sure whether this is right, actually..

Hmm ... at least one of the paths through internal_get_result_type
is intentionally blessing the result tupdesc:

            if (tupdesc->tdtypeid == RECORDOID &&
                tupdesc->tdtypmod < 0)
                assign_record_type_typmod(tupdesc);

but it's not clear if they all do, and the comments certainly
aren't promising it.

I'd be in favor of making this a documented API promise,
but it isn't that right now.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures
Next
From: John Naylor
Date:
Subject: Re: slab allocator performance issues