pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: MichaelDBA <MichaelDBA@sqlexec.com>
To: Godfrin, Philippe E <Philippe.Godfrin@nov.com>
Cc: Achilleas Mantzios <achill@matrix.gatewaynet.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: [EXTERNAL] Re: Limits user connection in pgbouncer
Date: Mon, 13 Dec 2021 08:07:32 -0500
Message-ID: <1da96539-bdef-4158-1e38-fa95371c464e@sqlexec.com> (raw)
In-Reply-To: <SA0PR15MB39338FB3CDBCEA42C55E7A9882749@SA0PR15MB3933.namprd15.prod.outlook.com>
References: <CALfOM6Kjqq5RGDj7K5KWRqX8YcCNFriN258H4jW418Nb8FC7EA@mail.gmail.com>
	<3f48f38a-c3f5-205b-1d4f-6e561417272e@matrix.gatewaynet.com>
	<SA0PR15MB39338FB3CDBCEA42C55E7A9882749@SA0PR15MB3933.namprd15.prod.outlook.com>

Hi all,

If you add the user to the database specification, then you can limit 
connections per user:
db1 = host=localhost dbname=db1 pool_size=2 user=myuser

Regards,
Michael Vitale


Godfrin, Philippe E wrote on 12/13/2021 7:57 AM:
> On 13/12/21 10:05 π.μ., Daulat wrote:
>> Hello Team,
>> How can we limit the user to  make a specific number of connections 
>> to the database?
> Just specify this in the db definition configuration :
>
> db1 = host=localhost dbname=db1 pool_size=2
>
> but it will apply to every user, so that every user's pool will have 
> max 2 connections, not only user1.
>
> Alternatively you could set "ALTER ROLE .. CONNECTION LIMIT connlimit 
> " for user1 individually.

view thread (16+ messages)  latest in thread

Message-ID: <1da96539-bdef-4158-1e38-fa95371c464e@sqlexec.com>
Permalink:  ../1da96539-bdef-4158-1e38-fa95371c464e@sqlexec.com/
Also on:    postgresql.org/message-id/1da96539-bdef-4158-1e38-fa95371c464e@sqlexec.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: MichaelDBA@sqlexec.com, Philippe.Godfrin@nov.com, achill@matrix.gatewaynet.com, pgsql-admin@lists.postgresql.org
  Subject: Re: [EXTERNAL] Re: Limits user connection in pgbouncer
  In-Reply-To: <1da96539-bdef-4158-1e38-fa95371c464e@sqlexec.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox