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.94.2) (envelope-from ) id 1u0oe9-008R2s-DM for pgsql-bugs@arkaria.postgresql.org; Fri, 04 Apr 2025 21:32:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u0oe8-0057ro-2r for pgsql-bugs@arkaria.postgresql.org; Fri, 04 Apr 2025 21:32:16 +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.94.2) (envelope-from ) id 1u0oe7-0057rg-Qw for pgsql-bugs@lists.postgresql.org; Fri, 04 Apr 2025 21:32:15 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u0oe6-002zFR-0W for pgsql-bugs@lists.postgresql.org; Fri, 04 Apr 2025 21:32:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 534LWDlY2047361; Fri, 4 Apr 2025 17:32:13 -0400 From: Tom Lane To: luy70@psu.edu cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18879: PostgreSQL returns memory error. In-reply-to: <18879-259fc59d072bd4d7@postgresql.org> References: <18879-259fc59d072bd4d7@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Fri, 04 Apr 2025 19:33:44 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2047359.1743802333.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Apr 2025 17:32:13 -0400 Message-ID: <2047360.1743802333@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > CREATE LOCAL TEMP TABLE IF NOT EXISTS v878825600 ( c878825601 INT > COMPRESSION DEFAULT CONSTRAINT cons_878825602 REFERENCES v878825600 MATC= H > SIMPLE ON UPDATE NO ACTION ON DELETE SET DEFAULT ( c878825601, c87882560= 1, > c878825601, c878825601, c878825601, c878825601, c878825601 ) PRIMARY KEY= ) > ON COMMIT DELETE ROWS; Thanks for the report. A less illegible repro is regression=3D# create temp table v1 (c1 int primary key references v1 on d= elete set default (c1,c1)); WARNING: problem in alloc set PortalContext: detected write past chunk en= d in block 0x2c25bc0, chunk 0x2c25e20 WARNING: problem in alloc set PortalContext: detected write past chunk en= d in block 0x2c25bc0, chunk 0x2c25e20 CREATE TABLE (With more repetitions of "c1" you can get a crash.) It looks like we're not being careful to reject duplicates in the SET DEFAULT list. regards, tom lane