Re: limiting connections per user/database - Mailing list pgsql-patches

From Heikki Linnakangas
Subject Re: limiting connections per user/database
Date
Msg-id Pine.OSF.4.61.0506262207320.153374@kosh.hut.fi
Whole thread Raw
In response to Re: limiting connections per user/database  (Petr Jelínek <pjmodos@parba.cz>)
List pgsql-patches
On Sun, 26 Jun 2005, Petr Jelínek wrote:

> Alvaro Herrera wrote:
>
>> Maybe you could make some checks against the shared array of PGPROCs
>> (procarray.c), for the per-database limit at least.  Not sure about
>> per-user limit.
>>
> Thats good idea (I could maybe add userid to PGPROC struct too) but I think
> there could be problem with two phase commits because they add new entry to
> that array of PGPROCs too and I don't kow if we want to include them to that
> limit.

You can ignore PGPROCs that belong to prepared transactions. They have 0
in the pid field, see TransactionIdIsActive and
CountActiveBackends functions in procarray.c for an example.

- Heikki

pgsql-patches by date:

Previous
From: Petr Jelínek
Date:
Subject: Re: limiting connections per user/database
Next
From: Alvaro Herrera
Date:
Subject: Re: limiting connections per user/database