Обсуждение: Patch to handle connection limit for roles
Hi, This patch handles the connection limit parameter for roles. This parameter is available since 8.1 but apparently, pgAdmin doesn't handle this yet. Regards. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com
Вложения
On Tue, Dec 30, 2008 at 6:36 PM, Guillaume Lelarge <guillaume@lelarge.info> wrote: > Hi, > > This patch handles the connection limit parameter for roles. This > parameter is available since 8.1 but apparently, pgAdmin doesn't handle > this yet. HI, Looks good to the eyeballs, except that as far as I can see, the patch assumes the user is always using 8.1 or above and will not play nicely with 8.0. I think you need to add a liberal smattering of 'if (conn->BackendMinimumVersion(8, 1))'. -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com
Dave Page a écrit : > On Tue, Dec 30, 2008 at 6:36 PM, Guillaume Lelarge > <guillaume@lelarge.info> wrote: >> Hi, >> >> This patch handles the connection limit parameter for roles. This >> parameter is available since 8.1 but apparently, pgAdmin doesn't handle >> this yet. > > HI, > > Looks good to the eyeballs, except that as far as I can see, the patch > assumes the user is always using 8.1 or above and will not play nicely > with 8.0. I think you need to add a liberal smattering of 'if > (conn->BackendMinimumVersion(8, 1))'. > I assumed that pgRole and dlgRole are only used with roles (so PostgreSQL 8.1 at least), and that pgUser and dlgUser are used with older PostgreSQL releases. I just check this and my patch works for me on 8.0. Is there something I misunderstood ? -- Guillaume. http://www.postgresqlfr.org http://dalibo.com
On Wed, Dec 31, 2008 at 11:00 AM, Guillaume Lelarge <guillaume@lelarge.info> wrote: > Dave Page a écrit : >> On Tue, Dec 30, 2008 at 6:36 PM, Guillaume Lelarge >> <guillaume@lelarge.info> wrote: >>> Hi, >>> >>> This patch handles the connection limit parameter for roles. This >>> parameter is available since 8.1 but apparently, pgAdmin doesn't handle >>> this yet. >> >> HI, >> >> Looks good to the eyeballs, except that as far as I can see, the patch >> assumes the user is always using 8.1 or above and will not play nicely >> with 8.0. I think you need to add a liberal smattering of 'if >> (conn->BackendMinimumVersion(8, 1))'. >> > > I assumed that pgRole and dlgRole are only used with roles (so > PostgreSQL 8.1 at least), and that pgUser and dlgUser are used with > older PostgreSQL releases. I just check this and my patch works for me > on 8.0. > > Is there something I misunderstood ? Nope - pre-coffee brain failure on my part. Please go ahead and commit - sorry for the noise! -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com
Dave Page a écrit : > On Wed, Dec 31, 2008 at 11:00 AM, Guillaume Lelarge > <guillaume@lelarge.info> wrote: >> Dave Page a écrit : >>> On Tue, Dec 30, 2008 at 6:36 PM, Guillaume Lelarge >>> <guillaume@lelarge.info> wrote: >>>> Hi, >>>> >>>> This patch handles the connection limit parameter for roles. This >>>> parameter is available since 8.1 but apparently, pgAdmin doesn't handle >>>> this yet. >>> HI, >>> >>> Looks good to the eyeballs, except that as far as I can see, the patch >>> assumes the user is always using 8.1 or above and will not play nicely >>> with 8.0. I think you need to add a liberal smattering of 'if >>> (conn->BackendMinimumVersion(8, 1))'. >>> >> I assumed that pgRole and dlgRole are only used with roles (so >> PostgreSQL 8.1 at least), and that pgUser and dlgUser are used with >> older PostgreSQL releases. I just check this and my patch works for me >> on 8.0. >> >> Is there something I misunderstood ? > > Nope - pre-coffee brain failure on my part. Please go ahead and commit > - sorry for the noise! > No problem :) Thanks, I commited it. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com