On Fri, Jul 31, 2026 at 11:03 PM Peter Geoghegan <[email protected]> wrote:
> The attached isolation test patch (written by Claude code) shows that
> the new RI fast path can get some things wrong when a foreign key uses
> a cross-type equality operator.

Opus 5 flagged an independent problem in the RI fast path work. This
one appears to be a resource management issue.

When I run the foreign_key tests with the attached patch applied, I
see these failures:

#  END$$;
#  CREATE TRIGGER fp_expand_kit_trg AFTER INSERT ON fp_order
#      FOR EACH ROW EXECUTE FUNCTION fp_expand_kit();
#  INSERT INTO fp_order VALUES (1, 1, 1);
# +WARNING:  resource was not closed: relation "fp_product"
# +WARNING:  resource was not closed: relation "fp_product_pkey"
# +WARNING:  resource was not closed: TupleDesc 0x7f7e109a3448 (34085,-1)
# +WARNING:  resource was not closed: TupleDesc 0x7f7e109a2cd8 (34068,-1)
#  NOTICE:  order 1 expanded into 3 order items

Right afterwards, "Assert(rel->rd_refcnt > 0)" fails within
RelationDecrementReferenceCount().

-- 
Peter Geoghegan

Attachment: 0001-Add-test-the-RI-fast-path-FK-cache-outlives-the-port.patch
Description: Binary data

Reply via email to