Re: [EXTERNAL] Re: Crash in record_type_typmod_compare

Jeff Davis <pgsql@j-davis.com>

From: Jeff Davis <pgsql@j-davis.com>
To: Sait Talha Nisanci <Sait.Nisanci@microsoft.com>, Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>, Metin Doslu <Metin.Doslu@microsoft.com>
Date: 2021-07-10T17:58:29Z
Lists: pgsql-hackers
On Mon, 2021-04-05 at 12:07 +0000, Sait Talha Nisanci wrote:
> Hi Andres,
> 
> Please see the updated patch, do you mean something like this? (there
> might be a simpler way for doing this)
> 

Committed with minor revisions.

My patch also avoids incrementing NextRecordTypmod until we've already
called CreateTupleDescCopy(). Otherwise, an allocation failure could
leave NextRecordTypmod unnecessarily incremented, which is a tiny leak.

Regards,
	Jeff Davis





Commits

  1. Fix assign_record_type_typmod().

  2. Improve an error message