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 1vkwc8-004sVD-2M for pgsql-general@arkaria.postgresql.org; Wed, 28 Jan 2026 03:53: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 1vkwb7-00H5vA-2o for pgsql-general@arkaria.postgresql.org; Wed, 28 Jan 2026 03:52:06 +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 1vkwb7-00H5v1-1j for pgsql-general@lists.postgresql.org; Wed, 28 Jan 2026 03:52:05 +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 1vkwb4-002fnv-1p for pgsql-general@lists.postgresql.org; Wed, 28 Jan 2026 03:52:05 +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 60S3q06E729686; Tue, 27 Jan 2026 22:52:00 -0500 From: Tom Lane To: "David G. Johnston" cc: Gus Spier , pgsql-general Subject: Re: Attempting to delete excess rows from table with BATCH DELETE In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Tue, 27 Jan 2026 20:39:03 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <729684.1769572320.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 27 Jan 2026 22:52:00 -0500 Message-ID: <729685.1769572320@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Tuesday, January 27, 2026, Gus Spier wrote: >> I write a procedure to accomplish all this work but it persists in >> returning a error to the effect that a COMMIT is not valid in a block >> tht tries to DELETE data. > Haven’t tested to be sure but this doesn’t seem like a community edition > limitation. Yeah, you can definitely do that in standard Postgres (at least since we invented procedures). Sounds like Aurora is behind the times. I know that their storage engine is fundamentally different from ours; perhaps it has problems with this idea. > You’d have to move the logic to a proper client application that executes > top-level commands. Yup. regards, tom lane