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: 42C14245.2090101@parba.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Hi,

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

--
Regards
Petr Jelinek (PJMODOS)

Attachment Content-Type Size
maxconnlimit.patch text/plain 35.2 KB

Responses

Browse pgsql-patches by date

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