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 1wRxIZ-002pxo-0q for pgsql-bugs@arkaria.postgresql.org; Tue, 26 May 2026 19:18:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wRxIV-005hFj-0s for pgsql-bugs@arkaria.postgresql.org; Tue, 26 May 2026 19:18:40 +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 1wRx0X-005h1e-2u for pgsql-bugs@lists.postgresql.org; Tue, 26 May 2026 19:00:06 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wRx0X-00000000tuq-0hH7 for pgsql-bugs@lists.postgresql.org; Tue, 26 May 2026 19:00:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=vvA8B3V8S5oz2vKUP7zhqwjJJPEIH4HFdxEmRhRSJDY=; b=tWglsnzhW73BWgnEk1B8/Qm8Tw CZ5IvaLPsgBz7UQ744wi4kxauxGHaT7d2WIXYh3QL/NtTcZmfzEoxGr3a9M4md6neTEoU3kf5URy1 te5xr0NiNH78lZfPDPjA02e/MBDYLWuk/98yDHvCzoO99oitNXsbFkuAAp/uM3OdeQPezEjlwF2k7 56zLSa3fVvfjbcGtMVdlgVosTnQDCjkR0h8Y8ueDwcsaK7HOt/tnOaFDJeZAlZb5k/Eg77Q3hANs/ OA1v4ENONOm6ASDB+IeNhJCE1aOp+RY2EAcsLBq9nbd5gksxE8vbNlIweZNhBAak34zN7d2nn49Fs 22bz0OOA==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wRx0W-002qOk-2P for pgsql-bugs@lists.postgresql.org; Tue, 26 May 2026 19:00:04 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wRx0V-009F2q-2J for pgsql-bugs@lists.postgresql.org; Tue, 26 May 2026 19:00:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19494: Error on transaction commit inside pipeline triggers psql's Assert To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: exclusion@gmail.com Reply-To: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Date: Tue, 26 May 2026 19:00:01 +0000 Message-ID: <19494-97a86d84fee71c47@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19494 Logged by: Alexander Lakhin Email address: exclusion@gmail.com PostgreSQL version: 18.4 Operating system: Ubuntu 24.04 Description: =20 The following psql script: CREATE TABLE t(a INTEGER PRIMARY KEY DEFERRABLE INITIALLY DEFERRED); \startpipeline INSERT INTO t VALUES ($1), ($1) RETURNING * \bind 1 \sendpipeline \endpipeline results in: a --- 1 1 (2 rows) ERROR: duplicate key value violates unique constraint "t_pkey" DETAIL: Key (a)=3D(1) already exists. psql: common.c:1503: discardAbortedPipelineResults: Assertion `pset.available_results > 0' failed. Program terminated with signal SIGABRT, Aborted. (gdb) bt #0 __pthread_kill_implementation (threadid=3D281473811984096, signo=3Dsigno@entry=3D6, no_tid=3Dno_tid@entry=3D0) at ./nptl/pthread_kill.c:44 #1 0x0000ffffba60b718 [PAC] in __pthread_kill_internal (threadid=3D, signo=3D6) at ./nptl/pthread_kill.c:89 #2 0x0000ffffba5b757c in __GI_raise (sig=3Dsig@entry=3D6) at ../sysdeps/posix/raise.c:26 #3 0x0000ffffba5a1d48 [PAC] in __GI_abort () at ./stdlib/abort.c:77 #4 0x0000ffffba5b05e0 [PAC] in __assert_fail_base (fmt=3D, assertion=3D, file=3D0xaaaac5a317a8 "common.c", line=3D1503, function=3D) at ./assert/assert.c:118 #5 0x0000aaaac59d3ffc [PAC] in discardAbortedPipelineResults () at common.c:1503 #6 0x0000aaaac59d4b28 in ExecQueryAndProcessResults (query=3D0xaaaae5929250 "INSERT INTO t VALUES ($1), ($1) RETURNING * ", elapsed_msec=3D0xffffe4d657b0, svpt_gone_p=3D0xffffe4d657af, is_watch= =3Dfalse, min_rows=3D0, opt=3D0x0, printQueryFout=3D0x0) at common.c:1830 #7 0x0000aaaac59d37b0 in SendQuery (query=3D0xaaaae5929250 "INSERT INTO t VALUES ($1), ($1) RETURNING * ") at common.c:1214 #8 0x0000aaaac59ee4f8 in MainLoop (source=3D0xffffba730870 <_IO_2_1_stdin_= >) at mainloop.c:515 #9 0x0000aaaac59cd488 in process_file (filename=3D0x0, use_relative_path=3Dfalse) at command.c:4977 #10 0x0000aaaac59fbbcc in main (argc=3D10, argv=3D0xffffe4d65f68) at startup.c:424 Reproduced starting from 41625ab8e (with s/\sendpipeline/\g/ before 17caf6644).