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 1ubwrZ-007Cvf-9j for pgsql-general@arkaria.postgresql.org; Wed, 16 Jul 2025 07:47:37 +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 1ubwrW-008XYB-9j for pgsql-general@arkaria.postgresql.org; Wed, 16 Jul 2025 07:47:34 +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.94.2) (envelope-from ) id 1ubwrV-008XY3-SV for pgsql-general@lists.postgresql.org; Wed, 16 Jul 2025 07:47:34 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ubwrT-0081LL-1T for pgsql-general@lists.postgresql.org; Wed, 16 Jul 2025 07:47:33 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-ae0dffaa8b2so1241952166b.0 for ; Wed, 16 Jul 2025 00:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fortnox.se; s=google; t=1752652050; x=1753256850; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=jW3C8ZpBCYcUKGK/EF7sHJi0M/RZV4W8v41J82m0U/E=; b=E3siu1BLvC/DyWmJv1JMSuo3t36sV/C+R2cM/nkER4hNLRLCM0XKIxHa1hvYN7k+9x fAX3PnwJYzLNQ7QYISQBTvnGWvJLUHasRStQu/AwKsM2ZrpoTfrxopuCb9GZ8Ct97VUf 9UttfJQA+/YgoGS2wWybzYOM8VSAcOaTMEExCr8pRt1TtAxvxxsnwvEGrH0tu2ve2slA TUVYwkM6rB344mBoeQQl4DkgoO0i5YoTNPmUhyoKJazN9jg9jvL3G/FhGGY2LLSjTA6x 9L/LzpkXmhQAjjiwH5Y6/+FJXOLFqkuafB4rX6GhE6R7/h3eKHPFofsecScCXAEKr9zp 1PvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752652050; x=1753256850; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jW3C8ZpBCYcUKGK/EF7sHJi0M/RZV4W8v41J82m0U/E=; b=oD2EObDTJPhBKT3F8CvGbU3nD6gDEACaoUVCpH4nT49fvyhmx/xiFRommEeulRtbVS Ma4L5MLAH9BHDd+73RbiNNmQkS18cJ4n178zuUhxEIGTI3XsfrQHTGT03kGWOw5d7m8B IGeaT90ATXeQflp6J1NgCYQzlagFjm0rPy2dTZ7yXyY97f0tnmfUTInctX7Xrlrt9eg1 DyucuQgYoh6UsDTG08cDYLpLb2rDHnWos/+8AMulO2VQzmiHcBqiLzX+rVEOo3VMHyo4 1AdWIFLZZPR65lkLcpRuJvoNz0KdECLrkUibk1KO+OA1MSvfSKVG9LuunLDUctY0zruL hRkQ== X-Gm-Message-State: AOJu0Yyu1E8iwSzO6B9s7wmGuOGRC8Hsiu6TPlIgMHOt8lQJio9GhwQa nDKNN8z+fChkfDaotYUKAuF26UY3rowrvkBYN7zrJgKuaY7XBMYa21jEbp3ZZBiV4RjHHneiGFs x7DQFGPiu/BMRK44Wva08x9Ck4XPvLgkdfofcfFUHMBaWQB1YC0xcS2Sngvnj+YVA8UPUGEdmtN i8qvLtkos1ZfSwA8aMHb4TwOZqbbNVVFRv2/7TYRiQTw== X-Gm-Gg: ASbGncvs4rwoRnENTpTdue7dyyZyVwQ5tIv+CN8+YgnNs16rFTyCMgFhFr+Wnm5yyJA MMNHUIiuuMgeViKCKtj0H76HQSyHUQbPuVviNwsSv87RLyIEfRt7Lb9JnCBWFcmBbBypx7/hiX0 8CB3H3JoH6Mkbdebcpdm71qqsJpd6tnfSBTld0a30yi8+gVvMSfjTxCtDzEcJIcXrbV+8eUEsGE UK9DxnI/KDm31TxxW5l X-Google-Smtp-Source: AGHT+IG2MZlmEXR2i1VBP9/5pAnB2KCleeAkM6ONfMwP/MnM5/7iGVr9tf/x+yJcfe7Cq7vc0z081GDqpTQKSd2dwIE= X-Received: by 2002:a17:907:7244:b0:ae3:8c9b:bd61 with SMTP id a640c23a62f3a-ae9c99568d0mr236884966b.12.1752652049884; Wed, 16 Jul 2025 00:47:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Robert_Sj=C3=B6blom?= Date: Wed, 16 Jul 2025 09:47:18 +0200 X-Gm-Features: Ac12FXwK2_jTrNo35Y9sOIZzmHpeKcwaCjWuiX6bOfG1J4ZI0Seatbz6KBLiWRs Message-ID: Subject: Re: PgBouncer-Postgres : un supported startup parameter statement_timeout To: KK CHN Cc: pgsql-general Content-Type: multipart/alternative; boundary="000000000000d95162063a071a08" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d95162063a071a08 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable There's an option to ignore parameters in pgbouncer's config. Here's an SO answer that gives an example: https://stackoverflow.com/a/36911794 On Wed, 16 Jul 2025, 09:19 KK CHN, wrote: > Hi, > > I am facing an issue with PgBouncer-Postgres setup, > > *PgBouncer (PgBouncer 1.23.1 running on VM instance FreeBSD 14.2) and > PostgreSQL DB cluster on a virtual machine (PG version 16.0, RHEL 9.4) *= . > > > > My application backend is nodeJS which throws the following Error in the > nodejs console log: when connecting through pgbouncer to the backend > database server... > > ERROR thrown: > > my-node>* Failed to connect to PostgreSQL database transaction_db : > unsupported startup parameter: statement_timeout *{"code":"08P01", > "length":69, "name": "error", xx xx > my-node> error:[object Object ] {"timestamp":"15-07-2025 10:14:26"} x x x= x > > > Note: The nodejs apps earlier directly establishing connections to the > PostgreSQL DB ( no such errors) now redirected via Pgbouncer throws > this error. > > > > *The config parameters for pgbouncer as follows(correct me if any > mistakes made)* > [root@pgbouncer ~]# grep ^[^';;;'] /usr/local/etc/pgbouncer.ini > [databases] > transaction_db =3D host=3Ddbmain.mydomain.com port=3D5444 dbname=3Dtransa= ction_db > > [users] > [pgbouncer] > Logfile =3D /var/log/pgbouncer/pgbouncer.log > pidfile =3D /var/run/pgbouncer/pgbouncer.pid > listen_addr =3D * > listen_port =3D 5444 > auth_type =3D md5 > auth_file =3D /usr/local/etc/pgbouncer.users > admin_users =3D adminuser > stats_users =3D adminuser, > pool_mode =3D transaction > server_reset_query =3D DISCARD ALL > server_reset_query_always =3D 1 > ignore_startup_parameters =3D extra_float_digits // I have added this al= so > or can I add these options too in the following line ? > ;; ignore_startup_parameters =3D extra_float_digits, options, > statement_timeout, idle_in_transaction_session_timeout // doubt options > supported in latest versions ? > > max_client_conn =3D 5000 // can I give this much high value ? > default_pool_size =3D 20 > min_pool_size =3D 10 > reserve_pool_size =3D 10 > reserve_pool_timeout =3D 5 > max_db_connections =3D 100 > max_user_connections =3D 30 > server_lifetime =3D 3600 > server_idle_timeout =3D 600 // is this a low value or need to be increas= ed ? > [root@pgbouncer ~]# > > > > The config params of N*odeJS application which uses nodejs connection > pooling in* code as follows > > the Node JS application using the following nodejs pooling configuration= s > for the application level > > *cat app_10072025/config/pg-pool-config.js* > ....... > > > > > > > > > *const poolOptions =3D { max: 10, min: 2, idleTimeoutMillis: > 600000, //Idle for 5Min connectionTimeoutMillis: 10000, //Reconnect > 10sec statement_timeout: 60000, //Query executiion 1 min acquire= : > 20000, maxUses: 1000 //reconnect after 1000 queries};* > > const pools =3D { > > transaction_db: new Pool({ > connectionString: `postgresql://${DB_USER}:${DB_PASSWORD}@ > ${DB_HOST}:${DB_PORT}/${DB_NAME_TRANSACTION_DB}`, > ...poolOptions, > }), > }; > > .................................. > > Any hints and suggestions in the config params are most welcome. > > Thank you, > Krishane > --=20 Inneh=C3=A5llet i detta e-postmeddelande =C3=A4r konfidentiellt och avsett = endast f=C3=B6r=20 adressaten.Varje spridning, kopiering eller utnyttjande av inneh=C3=A5llet = =C3=A4r=20 f=C3=B6rbjuden utan till=C3=A5telse av avs=C3=A4ndaren.=C2=A0Om detta medde= lande av misstag=20 g=C3=A5tt till fel adressat v=C3=A4nligen radera det ursprungliga meddeland= et och=20 underr=C3=A4tta avs=C3=A4ndaren via e-post --000000000000d95162063a071a08 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
There's an option to ignore parameters in pgbouncer&#= 39;s config. Here's an SO answer that gives an example:=C2=A0https://stackoverflow.com/a/36911794=

On Wed, 16 Jul 2025, 09:19 KK CHN, <kkchn.in@gmail.com> wrote:
Hi,

<= div>I am facing an issue with PgBouncer-Postgres setup,=C2=A0

Pg= Bouncer (PgBouncer 1.23.1 running on VM instance FreeBSD 14.2) and PostgreS= QL DB cluster on a virtual machine (PG version 16.0, =C2=A0RHEL 9.4)=C2=A0<= /b>. =C2=A0


My=C2=A0application backend is nodeJS which throws t= he following Error in the nodejs=C2=A0 console log: when connecting through= pgbouncer to the backend database server...=C2=A0

ERROR thrown:

my-node>=C2=A0Failed to connect to PostgreSQL d= atabase transaction_db : unsupported startup parameter: statement_timeout= =C2=A0{"code":"08P01", "length":69, "= ;name": "error", xx xx
my-node> error:[object Object ]= {"timestamp":"15-07-2025 10:14:26"} x x xx


= Note:=C2=A0 =C2=A0The nodejs apps =C2=A0earlier directly establishing conne= ctions to the =C2=A0PostgreSQL DB ( no such errors) =C2=A0now redirected vi= a =C2=A0 Pgbouncer throws this error.
=C2=A0 =C2=A0

The config= parameters for =C2=A0pgbouncer as follows(correct me if any mistakes made)=

[root@pgbouncer ~]# grep ^[^';;;'] /usr/local/etc/pgbou= ncer.ini
[databases]
transaction_db =3D host=3Ddbmain.mydomain.com<= /a>=C2=A0port=3D5444 dbname=3Dtransaction_db

[users]
[pgbouncer]<= br>Logfile =3D /var/log/pgbouncer/pgbouncer.log
pidfile =3D /var/run/pgb= ouncer/pgbouncer.pid
listen_addr =3D *
listen_port =3D 5444
auth_t= ype =3D md5
auth_file =3D /usr/local/etc/pgbouncer.users
admin_users = =3D adminuser
stats_users =3D adminuser,
pool_mode =3D transactionserver_reset_query =3D DISCARD ALL
server_reset_query_always =3D 1
i= gnore_startup_parameters =3D extra_float_digits =C2=A0// I have added this = also or can I add these options too in the following line =C2=A0?
;; ign= ore_startup_parameters =3D extra_float_digits, options, statement_timeout, = idle_in_transaction_session_timeout =C2=A0// doubt options supported in lat= est versions ?

max_client_conn =3D 5000 =C2=A0 // can I give this mu= ch high value ?
default_pool_size =3D 20
min_pool_size =3D 10
rese= rve_pool_size =3D 10
reserve_pool_timeout =3D 5
max_db_connections = =3D 100
max_user_connections =3D 30
server_lifetime =3D 3600
serve= r_idle_timeout =3D 600 // is this a low value or need to be =C2=A0increased= ?
[root@pgbouncer ~]#



The config params of =C2=A0Node= JS application which uses nodejs connection pooling in=C2=A0code as fol= lows

the Node JS application using the following =C2=A0nodejs poolin= g configurations for the application level

cat app_10072025/confi= g/pg-pool-config.js
.......
const poolOptions =3D {
=C2=A0 = =C2=A0 max: 10,
=C2=A0 =C2=A0 min: 2,
=C2=A0 =C2=A0 idleTimeoutMillis= : 600000, =C2=A0 //Idle for 5Min
=C2=A0 =C2=A0 connectionTimeoutMillis: = 10000, =C2=A0//Reconnect 10sec
=C2=A0 =C2=A0 statement_timeout: 60000, = =C2=A0 =C2=A0//Query executiion 1 min
=C2=A0 =C2=A0 acquire: 20000,
= =C2=A0 =C2=A0 maxUses: 1000 //reconnect after 1000 queries
};

const pools =3D {
=C2=A0 =C2=A0
=C2=A0 =C2=A0 transaction_db: new Po= ol({
=C2=A0 =C2=A0 =C2=A0 =C2=A0 connectionString: `postgresql://${DB_US= ER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME_TRANSACTION_DB}`,
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 ...poolOptions,
=C2=A0 =C2=A0 }),
};

= ..................................

Any =C2=A0hints=C2=A0 =C2=A0and s= uggestions in the config params are most welcome.=C2=A0

Thank you,Krishane

Inneh=C3=A5llet i detta e-postmeddelande =C3=A4r konfidentiellt och= avsett endast f=C3=B6r adressaten.
Varje s= pridning, kopiering eller utnyttjande av inneh=C3=A5llet =C3=A4r f=C3=B6rbj= uden utan till=C3=A5telse av avs=C3=A4ndaren.=C2=A0Om detta meddelan= de av misstag g=C3=A5tt till fel adressat v=C3=A4nligen radera det ursprung= liga meddelandet och underr=C3=A4tta avs=C3=A4ndaren via e-post
--000000000000d95162063a071a08--