wish: limit number of connections per database - Mailing list pgsql-hackers

From bognár, attila
Subject wish: limit number of connections per database
Date
Msg-id 3F5F79DA.90309@netalfa.com
Whole thread Raw
Responses Re: wish: limit number of connections per database
List pgsql-hackers
Dear List,

I already asked my question on the admin list, but got no answer. As I 
even could not find any related information anywhere, I think my 
question is a wish:

Would it be possible to set the maximum number of connections to each 
database individually? I need this because the server will be shared 
between several users and I want to avoid that that somebody uses the 
maximum number of connections possible to the server, locking out others.

I am not familiar with the internals of postgresql, but maybe a column 
in pg_database could store the limit if any.

A similar solution would be if the number of connections could be 
limited per users, a similar column in pg_user could store the limit.

Or this limit could be configured as an additional column in pg_hba.conf.

How hard would it be to implement such a feature? As there is a check on 
each new connection to the server, maybe it would not be too difficult 
to check one constraint more :-)

I don't have much time to do it, but if you think it is not too hard and 
my limited knowledge in C is enough I would help doing it gladly.

These feature would be good even as a "hidden" feature, configurable 
only through psql after startup (file configuration support added later).

thanks,

attila





pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: quirk of array type processing
Next
From: Peter Eisentraut
Date:
Subject: Re: How to install and unistall