Re: Does TupleQueueReaderNext() really need to copy its result? - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Does TupleQueueReaderNext() really need to copy its result?
Date
Msg-id CA+TgmobMoAMrYStOkMmewpP7UDT4+_HZMZ=MHYW=NE8uy12A4Q@mail.gmail.com
Whole thread Raw
In response to Re: Does TupleQueueReaderNext() really need to copy its result?  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: Does TupleQueueReaderNext() really need to copy its result?  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Fri, Aug 23, 2019 at 10:22 PM Thomas Munro <thomas.munro@gmail.com> wrote:
> Couldn't resist trying this, and it seems to work.  Based on the
> comment "the buffer size is a multiple of MAXIMUM_ALIGNOF, and each
> read and write is as well", it should always work (though I wish
> shm_mq_receive_bytes()'s documentation would discuss message alignment
> explicitly if that's true).  On the other hand, I doubt it makes a
> difference, so this is more of a question: is this the way it was
> supposed to work?

There's a comment in htup.h which says:

 * * Separately allocated tuple: t_data points to a palloc'd chunk that
 *       is not adjacent to the HeapTupleData.  (This case is deprecated since
 *       it's difficult to tell apart from case #1.  It should be used only in
 *       limited contexts where the code knows that case #1 will never apply.)

I got scared and ran away.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proposal: Better generation of values in GENERATED columns.
Next
From: Tom Lane
Date:
Subject: Re: mingw32 floating point diff