Re: tableam scan-API patch broke foreign key validation

2019-04-25 Thread Alvaro Herrera
On 2019-Apr-06, Tom Lane wrote: > BTW, I just stumbled across a different bug in v11 by trying to run > HEAD's test script on it ... not sure if that's a known problem or not: > > (gdb) f 3 > #3 0x0063949c in ExecSetupPartitionTupleRouting ( > mtstate=, rel=0x7f343e4f4170) at execPar

Re: tableam scan-API patch broke foreign key validation

2019-04-07 Thread Andres Freund
Hi, On 2019-04-06 14:43:26 -0400, Tom Lane wrote: > Andres Freund 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 interna

Re: tableam scan-API patch broke foreign key validation

2019-04-06 Thread Tom Lane
Andres Freund writes: > On 2019-04-06 14:34:34 -0400, Tom Lane wrote: >> These are good questions. Just eyeing RI_FKey_check(), I think >> that it might not have any significant leaks because most of the work >> is done in an SPI context, but obviously that's pretty fragile. > Yea. And especiall

Re: tableam scan-API patch broke foreign key validation

2019-04-06 Thread Tom Lane
Andres Freund 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

Re: tableam scan-API patch broke foreign key validation

2019-04-06 Thread Andres Freund
Hi, On 2019-04-06 14:34:34 -0400, Tom Lane wrote: > Andres Freund writes: > > The relevant thread is: > > https://www.postgresql.org/message-id/20190325180405.jytoehuzkeozggxx%40alap3.anarazel.de > > Yeah, I just found that --- would have seen it sooner if David had > not elected to make it a ne

Re: tableam scan-API patch broke foreign key validation

2019-04-06 Thread Tom Lane
Andres Freund writes: > The relevant thread is: > https://www.postgresql.org/message-id/20190325180405.jytoehuzkeozggxx%40alap3.anarazel.de Yeah, I just found that --- would have seen it sooner if David had not elected to make it a new thread. > Wonder if you have an opinion on: >> I've also no

Re: tableam scan-API patch broke foreign key validation

2019-04-06 Thread Andres Freund
Hi, On 2019-04-06 14:13:29 -0400, Tom Lane wrote: > Andres Freund writes: > > On April 6, 2019 11:07:55 AM PDT, Tom Lane wrote: > >> I plan to go ahead and commit Hadi's fix with that change included > >> (as below), but I wonder whether anything else needs to be revisited. > > > I posted prett

Re: tableam scan-API patch broke foreign key validation

2019-04-06 Thread Tom Lane
Andres Freund writes: > On April 6, 2019 11:07:55 AM PDT, Tom Lane wrote: >> I plan to go ahead and commit Hadi's fix with that change included >> (as below), but I wonder whether anything else needs to be revisited. > I posted pretty much that patch nearby, with some other questions. Was > wai

Re: tableam scan-API patch broke foreign key validation

2019-04-06 Thread Andres Freund
Hi, On April 6, 2019 11:07:55 AM PDT, Tom Lane wrote: >It seems that the fire-the-triggers code path in >validateForeignKeyConstraint isn't being exercised; at least, that's >what coverage.postgresql.org says right now, and I'm afraid that may >have been true for quite some time. The attached re

tableam scan-API patch broke foreign key validation

2019-04-06 Thread Tom Lane
It seems that the fire-the-triggers code path in validateForeignKeyConstraint isn't being exercised; at least, that's what coverage.postgresql.org says right now, and I'm afraid that may have been true for quite some time. The attached regression-test addition causes it to be exercised, and guess