Re: tableam scan-API patch broke foreign key validation

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org, Hadi Moshayedi <hadi@moshayedi.net>
Date: 2019-04-06T18:43:26Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2019-04-06 14:34:34 -0400, Tom Lane wrote:
>> Why should this code need to free anything?  That'd be the responsibility
>> of the slot code, no?

> Well, not really. If a slot doesn't hold heap tuples internally,
> ExecFetchSlotHeapTuple() will return a fresh heap tuple (but signal so
> by setting *should_free = true if not NULL).

Ah, got it: ignoring should_free is indeed a potential issue here.

>> But clearly we need a test case here.  I'll adjust Hadi's example
>> so that there's more than one tuple to check, and push it.

> Cool.

Sounds like a plan.

			regards, tom lane



Commits

  1. Clean up side-effects of commits ab5fcf2b0 et al.

  2. Fix failures in validateForeignKeyConstraint's slow path.