I attached second try of per-database and per-user connection limit for
This time I am using information stored in ProcArray to get number of
connections - I modified PGPROC struct to also include userid.
Limits for user and database are stored in catalog tables. This aproach
led to implementation of "universal" ALTER DATABASE query (I followed
ALTER USER ad ALTER DATABASE ... RENAME implementatons). So queries for
setting maximum connections look like this: CREATE|ALTER DATABASE|USER
name MAX CONNECTIONS = 20;
Maximum connections defaults to zero which means unlimited (limited by
global maximum only) and isn't enforced for superusers.
The actual check for maximum conenctions is done in ReverifyMyDatabase
for database and InitializeSessionUser for user because we don't have
information from system catalog before so we don't know how many
connections are allowed.
Patch includes only changes to backend, I will make pg_dump, ecpg and
documentation patches once this is completed and accepted by team.
Diff is made against cvs from today morning GMT (apply with -p1 if you
want to test it) - cvs is down now so I can't make diff against repository.
Petr Jelinek (PJMODOS)
pgsql-patches by date
|Next:||From: Dave Page||Date: 2005-06-28 12:30:31|
|Subject: Dbsize backend integration|
|Previous:||From: Bruce Momjian||Date: 2005-06-28 12:09:47|
|Subject: Re: [BUGS] BUG #1707: statistics collector starts with stats_start_collector|