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 1wiWVZ-000GCn-1K for pgsql-bugs@arkaria.postgresql.org; Sat, 11 Jul 2026 12:08:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wiWVX-003oeA-2l for pgsql-bugs@arkaria.postgresql.org; Sat, 11 Jul 2026 12:08:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wi5nI-00GZMT-2H for pgsql-bugs@lists.postgresql.org; Fri, 10 Jul 2026 07:37:09 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wi5nG-00000000cCJ-1tlr for pgsql-bugs@lists.postgresql.org; Fri, 10 Jul 2026 07:37:09 +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=cUs9ORLNX5y4BX08C0Ea+xSjp8WhOKDfu3LaS1nhrns=; b=mwOj1t/TOcnZpvshEpGLJdKKl0 9RSQAbhKEC7RS04bnYjendAw9l3eD3ld21iVe8JWIKZvxovrtI+53j1DcFaAMWTPwIAeuhsIVNClA 9Mw+y9wgl7AkFUAKnlgBGEqTEW8qe5DOoDl58Q4nzDlsKxDfXFdOJrBCxOeqpTzPUqPaUg6MmmpHH Z0O+2AvMz9fzXWgho7lIrF9cR+Y8/I+32Xwk1wC9QsfLKAgj9g60kKI9vz61GnYULoJg/36Gp5S2k GIe0+ezRUXF9/4YvP4vGR5GyZ+YQKKlq3j26/ChZTBqk7jaxamCG6mb1Vwvl6ThBSYt5dwk2zGv4n Oz+XQTsA==; 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 1wi5nE-001Txf-2A for pgsql-bugs@lists.postgresql.org; Fri, 10 Jul 2026 07:37:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wi5nC-003Wg7-07 for pgsql-bugs@lists.postgresql.org; Fri, 10 Jul 2026 07:37:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19551: TRAP: failed Assert("max_pinned_buffers > 0") To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: r.zharkov@postgrespro.ru Reply-To: r.zharkov@postgrespro.ru, pgsql-bugs@lists.postgresql.org Date: Fri, 10 Jul 2026 07:36:39 +0000 Message-ID: <19551-d4a55b8fe81db4f2@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: 19551 Logged by: Roman Zharkov Email address: r.zharkov@postgrespro.ru PostgreSQL version: 17.10 Operating system: WSL2 on Windows 11 Description: =20 Hello, This error occurred when attempting run the temp.sql regression test from the master branch on the REL_17_STABLE (#bab0a2db). It seems, REL_16_STABLE and REL_18_STABLE work fine. Trimmed script: SET temp_buffers =3D 100; CREATE TEMPORARY TABLE test_temp(a int not null unique, b TEXT not null, cnt int not null); INSERT INTO test_temp SELECT generate_series(1, 10000) as id, repeat('a', 200), 0; -- should be at least 2x as large than temp_buffers SELECT pg_relation_size('test_temp') / current_setting('block_size')::int8 > 200; -- Don't want cursor names and plpgsql function lines in the error messages \set VERBOSITY terse /* helper function to create cursors for each page in [p_start, p_end] */ CREATE FUNCTION test_temp_pin(p_start int, p_end int) RETURNS void LANGUAGE plpgsql AS $f$ DECLARE cursorname text; query text; BEGIN FOR i IN p_start..p_end LOOP cursorname =3D 'c_'||i; query =3D format($q$DECLARE %I CURSOR FOR SELECT ctid FROM test_temp WHERE ctid >=3D '( %s, 1)'::tid $q$, cursorname, i); EXECUTE query; EXECUTE 'FETCH NEXT FROM '||cursorname; -- for test development -- RAISE NOTICE '%: %', cursorname, query; END LOOP; END; $f$; -- Test overflow of temp table buffers is handled correctly BEGIN; -- should work, below max SELECT test_temp_pin(0, 9); -- should fail, too many buffers pinned SELECT test_temp_pin(10, 105); ROLLBACK; Backtrace: =E2=80=A6 #5 0x0000643754e9190c in ExceptionalCondition (conditionName=3D0x6437550cc= f79 "max_pinned_buffers > 0", fileName=3D0x6437550cccf0 "/home/roman/git/connpool_build/build/../../connpool/src/backend/storage/ai= o/read_stream.c", lineNumber=3D473) at /home/roman/git/connpool_build/build/../../connpool/src/backend/utils/error= /assert.c:66 #6 0x0000643754c37a4f in read_stream_begin_relation (flags=3D2, strategy= =3D0x0, rel=3D0x7179e34caf78, forknum=3DMAIN_FORKNUM, callback=3D0x64375471e46b , callback_private_data=3D0x6437817b95a8, per_buffer_data_size=3D0) at /home/roman/git/connpool_build/build/../../connpool/src/backend/storage/aio= /read_stream.c:473 #7 0x000064375471f92d in heap_beginscan (relation=3D0x7179e34caf78, snapshot=3D0x64378169b868, nkeys=3D0, key=3D0x0, parallel_scan=3D0x0, flags= =3D272) at /home/roman/git/connpool_build/build/../../connpool/src/backend/access/heap= /heapam.c:1185 #8 0x0000643754a1df61 in table_beginscan_tidrange (rel=3D0x7179e34caf78, snapshot=3D0x64378169b868, mintid=3D0x6437817b87e0, maxtid=3D0x6437817b87e6= ) at /home/roman/git/connpool_build/build/../../connpool/src/include/access/tabl= eam.h:1097 #9 0x0000643754a1e787 in TidRangeNext (node=3D0x6437817b86f8) at /home/roman/git/connpool_build/build/../../connpool/src/backend/executor/no= deTidrangescan.c:243 #10 0x00006437549d23cc in ExecScanFetch (node=3D0x6437817b86f8, accessMtd=3D0x643754a1e6d8 , recheckMtd=3D0x643754a1e805 ) at /home/roman/git/connpool_build/build/../../connpool/src/backend/executor/ex= ecScan.c:139 #11 0x00006437549d2471 in ExecScan (node=3D0x6437817b86f8, accessMtd=3D0x643754a1e6d8 , recheckMtd=3D0x643754a1e805 ) at /home/roman/git/connpool_build/build/../../connpool/src/backend/executor/ex= ecScan.c:205 #12 0x0000643754a1e8ff in ExecTidRangeScan (pstate=3D0x6437817b86f8) at /home/roman/git/connpool_build/build/../../connpool/src/backend/executor/no= deTidrangescan.c:308 #13 0x00006437549cdc93 in ExecProcNodeFirst (node=3D0x6437817b86f8) at /home/roman/git/connpool_build/build/../../connpool/src/backend/executor/ex= ecProcnode.c:464 #14 0x00006437549c0c12 in ExecProcNode (node=3D0x6437817b86f8) at /home/roman/git/connpool_build/build/../../connpool/src/include/executor/ex= ecutor.h:278 #15 0x00006437549c3b4e in ExecutePlan (queryDesc=3D0x6437816c3520, operation=3DCMD_SELECT, sendTuples=3Dtrue, numberTuples=3D1, direction=3DForwardScanDirection, dest=3D0x6437552bda80 ) at /home/roman/git/connpool_build/build/../../connpool/src/backend/executor/ex= ecMain.c:1689 #16 0x00006437549c12dd in standard_ExecutorRun (queryDesc=3D0x6437816c3520, direction=3DForwardScanDirection, count=3D1, execute_once=3Dfalse) at /home/roman/git/connpool_build/build/../../connpool/src/backend/executor/ex= ecMain.c:360 #17 0x00006437549c1136 in ExecutorRun (queryDesc=3D0x6437816c3520, direction=3DForwardScanDirection, count=3D1, execute_once=3Dfalse) at /home/roman/git/connpool_build/build/../../connpool/src/backend/executor/ex= ecMain.c:306 #18 0x0000643754c9b597 in PortalRunSelect (portal=3D0x6437816c6b78, forward=3Dtrue, count=3D1, dest=3D0x6437552bda80 ) at /home/roman/git/connpool_build/build/../../connpool/src/backend/tcop/pquery= .c:922 #19 0x0000643754c9c763 in DoPortalRunFetch (portal=3D0x6437816c6b78, fdirection=3DFETCH_FORWARD, count=3D1, dest=3D0x6437552bda80 ) at /home/roman/git/connpool_build/build/../../connpool/src/backend/tcop/pquery= .c:1665 #20 0x0000643754c9c0ff in PortalRunFetch (portal=3D0x6437816c6b78, fdirection=3DFETCH_FORWARD, count=3D1, dest=3D0x6437552bda80 ) at /home/roman/git/connpool_build/build/../../connpool/src/backend/tcop/pquery= .c:1416 #21 0x0000643754930f24 in PerformPortalFetch (stmt=3D0x64378153d3f0, dest=3D0x6437552bda80 , qc=3D0x7ffc60e51fc0) at /home/roman/git/connpool_build/build/../../connpool/src/backend/commands/po= rtalcmds.c:198 #22 0x0000643754c9d8c9 in standard_ProcessUtility (pstmt=3D0x64378153d2e0, queryString=3D0x643781539a20 "FETCH NEXT FROM c_99", readOnlyTree=3Dtrue, context=3DPROCESS_UTILITY_QUERY, params=3D0x0, queryEnv=3D0x0, dest=3D0x643= 7552bda80 , qc=3D0x7ffc60e51fc0) at /home/roman/git/connpool_build/build/../../connpool/src/backend/tcop/utilit= y.c:703 =E2=80=A6