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 1vs16h-000jPh-0x for pgsql-general@arkaria.postgresql.org; Mon, 16 Feb 2026 16:05:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vs16g-003iiA-0O for pgsql-general@arkaria.postgresql.org; Mon, 16 Feb 2026 16:05:54 +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 1vs16f-003ihw-0L for pgsql-general@lists.postgresql.org; Mon, 16 Feb 2026 16:05:53 +0000 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vs16c-00000000uns-1sN4 for pgsql-general@lists.postgresql.org; Mon, 16 Feb 2026 16:05:52 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 08732EC06F4; Mon, 16 Feb 2026 11:05:50 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Mon, 16 Feb 2026 11:05:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1771257950; x=1771344350; bh=wIjTZgcQxdA/TnFxVBy3myLQhHqyZGrf5kczqEVvZ8Y=; b= RwZq7X6W6d9h6AVUkNJfWYFXwoHQ++AMlBjatFjaZ8LPz/11pfZqI6xE0/oQvD/j pD0u1+NhCkcEDyJPe5ec55C1xKhAVFUoa5v5bAuVq/VKXw3x9bNAly5CugZxrP+f VzO2okjZiZhWrVjJEIyk8NIh+vkxgteoeMm1sufeel4JyLU896lxpm+qf8H6HDF3 Phq1ZfVP+6EFAqWUdFwIe/ZaSG1mE0wv0Lyf9M/lutnxiAXBAj5nM6mEARYG9gir YobnbQHSL+hpX/wIj7ZuFZZjPXmJL9U9EImCK7Tt+ZWQsFz4r6UdgH/hAs27nuZD dHIAiPriKp5KFvviNLNL4A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1771257950; x=1771344350; bh=w IjTZgcQxdA/TnFxVBy3myLQhHqyZGrf5kczqEVvZ8Y=; b=lMq5dEVmJERo0JSU2 I7Kpm3CxNijlbFAsrlGb8F54FVU2pvsfozLsfriAYHAD4h2yefnqNay+FxzUxMgz 2spCUdYjrh/w5n5iRXmIakLeSnvdniwQzx6pWow+BK6VlsMBLVrCYjFZDgpWbXbJ JAETP0HD7I6z2KlDsS5KnGm3h0z9hrW5JDczCTD+Pfv31xGawOhALqjWY4uT8nCX uXE7Sdk3GLncrXwby5HpT2Se6Qlf1qdiSzM1a2uT3vro/UATtS1LCsqEUAPbkSBO +o3yh/nby+T0dUtr/FIedOJYKQPkNq7ua6fmFpJfg+XxkTYVlva9qWNCsFqDrWRR TLqNQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvudejfedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertd dtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgr vhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepieegjeevjeevfe ekudffuefgjeffveehvdeuvefgledugfeviedtkefgieduveefnecuffhomhgrihhnpehp ghgsohhunhgtvghrrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdp nhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepmhgrhh gvshhhphhoshhtghhrvghsleesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhl qdhgvghnvghrrghlsehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Feb 2026 11:05:49 -0500 (EST) Message-ID: <8c5e13fc-43a2-4739-bc87-d1f664cdb6ed@aklaver.com> Date: Mon, 16 Feb 2026 08:05:48 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgbouncer transaction pool mode issue for prepared statements To: Durgamahesh Manne , pgsql-general References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/16/26 05:24, Durgamahesh Manne wrote: > Hi PGDG Team > > > > We’re currently facing an issue with PgBouncer transaction pooling mode, > where prepared statements are failing, and we are unable to modify the > application code to disable or change how prepared statements are used. > > Switching to session pooling mode is not feasible for us because we have > a very high number of connections that we cannot fully control. > Environment details: PgBouncer version: 1.25.1 PostgreSQL version: 16.11 > >  The specific error we’re seeing is: > > bind message has 43 result formats but query has 47 columns > > ERROR: unnamed prepared statement does not exist Repeatedly logs > >  Has anyone encountered this issue with transaction pooling and > prepared statements? Are there any PgBouncer parameters or settings we > can use to mitigate this problem without requiring application‑level > changes? Any guidance or solutions would be greatly appreciated. A little exploration/searching would have revealed: https://www.pgbouncer.org/faq.html 5), How to use prepared statements with transaction pooling? Which leads to: https://www.pgbouncer.org/faq.html#how-to-use-prepared-statements-with-transaction-pooling which in turn leads to: https://www.pgbouncer.org/config.html#max_prepared_statements Note though the caveat in last link: "Note: This tracking and rewriting of prepared statement commands does not work for SQL-level prepared statement commands, so PREPARE, EXECUTE and DEALLOCATE are forwarded straight to Postgres. The exception to this rule are the DEALLOCATE ALL and DISCARD ALL commands, these do work as expected and will clear the prepared statements that PgBouncer tracked for the client that sends this command." > > Regards > Durga Mahesh -- Adrian Klaver adrian.klaver@aklaver.com