Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wwLR7-001v7D-0d for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Aug 2026 15:09:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wwLR4-00GJ5b-1c for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Aug 2026 15:09:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wwLR4-00GJ5T-0R for pgsql-hackers@lists.postgresql.org; Tue, 18 Aug 2026 15:09:07 +0000 Received: from mail-yw1-x1132.google.com ([2607:f8b0:4864:20::1132]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wwLR3-00000001EVT-2JRK for pgsql-hackers@postgresql.org; Tue, 18 Aug 2026 15:09:06 +0000 Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-81e6f0b4610so48939197b3.2 for ; Tue, 18 Aug 2026 08:09:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1787065745; x=1787670545; darn=postgresql.org; h=user-agent:in-reply-to:content-disposition:content-type :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to:content-type; bh=PZueqBOKIXytX7hsUdGpf92vXxZkIbDzn9ULB9oXXCU=; b=RK0J8NxHFuOfogXAdJbHzJ5RcZoIYlkC/Jmqig5VPtUDwOxWaYAfl4+L/w99rgKmt5 DbYvjE7Twz+AAIYaUePCdpHYewqOFzsicHahqySWnzVZztFlTHInljZmBexKu/ku+F+/ pEUuOZ55dz6v1b4P3LE+cPGKdOSh4eINEtlFE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787065745; x=1787670545; h=user-agent:in-reply-to:content-disposition:content-type :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=PZueqBOKIXytX7hsUdGpf92vXxZkIbDzn9ULB9oXXCU=; b=A/Fz4qkZMEoUqiOFAuNBNGfJF6QBNyfKpzmmJ8gyspX5dYlW6Oxmpl39S+ZdeO+jOU 9LQ4WK/yZWWv3LASAyymq6Q4SqSPpIH+3bd18gaoETpuAo95giJT+VKOIL3QFtdWbjH4 fFh9gJOxqaJdHauL4hmS6sD86SQFTIGyMw+wYm6SdadBzcz3UvzD+RDfmURzGOkQPIep SegI/yRqyCBMiEHVHPtzo32EGn85bce9tSDZrQBBLFXjPEvjtEJQx9HQyCg5xtZv/Lxk EOOTYqEBu+7yCV0+yfVCTR2CHNpcV2ROKKOoC38zFAgAWcsx2mgeg6cwJpIX2bzlUkBu JrYg== X-Forwarded-Encrypted: i=1; AHgh+Rp7JyuUvP80okzDhjyfS/wvyvzlGmQO3C4VSmFtn1H0hLwsyyOri12chm14ipcHo9UTual80vPhttcU70Ic@postgresql.org X-Gm-Message-State: AOJu0YxzoaeNCytK9hwolD3+mwsHnVVi5p/scGTPi/iWxHb97vZLupm8 FePyGxP9WpPwTyXvqxLzWq5GWHwD/Q6sFe5cXN8GJZtkYQzwMCjlT29ktebBc3CcNg== X-Gm-Gg: AR+sD11P00UIwK9BiKI3j/gAlunoxUboyCKC1JZiMz2gL4k8o3PTnGHEuSbHt01TAd0 LYFxIHaIIapWtT+zOrJlyPHmsDLxujEv3RInEbiUGvW9aetIFBgIB6RqZWs17iLBmSJj6B9Zl3Y 2T/4sYuopq/3hT1gVsd/vagILm+b77vGVEL1d62VTLWWHOTBq/+sSJuwWSP6OUmzoWQAXLFyZt9 9aUNPJB7t5xFtGAxgwzuimqDRTzilTccSwLo/0jm7cbqPMF1qc6x3HrDI3uAF/vabEGWq/JHvCy wbH0ysK2TQwoyLvHDj7r7m111+PKaSN4FtMiOmjIAiyjqHezbTWnPg/6EL67/fjvRNp/atBuEuO ANSNF63icFWryOGNewZ3tjjEa0LXbyMmYZVRJuLQ6tiEhP7NTLuHXmURAlQC6zWAV9yexvbiJTT fvrxa+1Qi09lN6xn9AmlYYPVUSCdDtGq97lUOsLs/6B7rCkOdEX467+wB/W488CU9bN96W755jw s1LLdM+ItACMrRIwSMP X-Received: by 2002:a05:690c:19:b0:81e:6bd6:39a5 with SMTP id 00721157ae682-8412cd49508mr33383717b3.1.1787065744703; Tue, 18 Aug 2026 08:09:04 -0700 (PDT) Received: from microsoft.com (c-73-15-160-255.hsd1.ca.comcast.net. [73.15.160.255]) by smtp.gmail.com with ESMTPSA id 00721157ae682-840f3d1fb12sm20397237b3.48.2026.08.18.08.09.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Aug 2026 08:09:04 -0700 (PDT) Date: Tue, 18 Aug 2026 08:09:01 -0700 From: Noah Misch To: Amit Langote Cc: Junwang Zhao , Ayush Tiwari , Nikolay Samokhvalov , pgsql-hackers mailing list , Andrey Borodin , Kirk Wolak Subject: Re: PG19 FK fast path: OOB write and missed FK checks during batched Message-ID: <20260818150901.a3.noahmisch@microsoft.com> References: <20260705222115.be.noahmisch@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.3.0 (2026-01-25) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Aug 18, 2026 at 10:42:14PM +0900, Amit Langote wrote: > After considering Peter's report of another bug [1] that is fixed by > 0001, I tested both his reproducer and nested firing involving the > same constraint. > > The latter exposed a problem in v1: the cache was still keyed only by > constraint OID, so a nested check of the same constraint reused the > outer entry and did not register a callback at the nested query depth. > In v2, the key is now (constraint OID, query depth), giving each > firing level its own entry and callback. > > 0001 now includes regression tests for both cases. 0002 and 0003 are unchanged. > > I would like to commit these sometime this week and would appreciate a review. I won't be able to review this. The list should consider it up for grabs. > [1] https://postgr.es/m/CAH2-Wz%3DD533JbF_ak_Pc8kP0FKse-ju8DnMxtjvY%3D%3DyHsP4xgw%40mail.gmail.com