Skip site navigation (1) Skip section navigation (2)

per user/database connections limit again

From: Petr Jelinek <pjmodos(at)parba(dot)cz>
To: pgsql-patches(at)postgresql(dot)org
Subject: per user/database connections limit again
Date: 2005-06-28 12:27:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches

I attached  second try of per-database and per-user connection limit for 
your review.

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 
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)

Attachment: maxconnlimit.patch
Description: text/plain (35.2 KB)


pgsql-patches by date

Next:From: Dave PageDate: 2005-06-28 12:30:31
Subject: Dbsize backend integration
Previous:From: Bruce MomjianDate: 2005-06-28 12:09:47
Subject: Re: [BUGS] BUG #1707: statistics collector starts with stats_start_collector

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group