Thread: psql and ROLES

psql and ROLES

From
Stefan Kaltenbrunner
Date:
Hi,

I'm currently working on syncing psql's tab-complete code with the docs
especially wrt ROLES. while working on this I noticed the following things:

*) there is no backslash command for getting a list of Roles (like \du &
\dg for Users and Groups) - I'm considering using \dr for that - does
that sound sensible ?

*) the new connectionlimit code allows for negative Limits (beside -1)
like this:

playground=# CREATE ROLE testrole LOGIN CONNECTION LIMIT -999999999;
CREATE ROLE

that doesn't strike me as that useful (and it is not clear what that
should mean anyway because such a user can still login) - so maybe we
should reject that (and create a sensible upper bound for that too)


Stefan


Re: psql and ROLES

From
Tom Lane
Date:
Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:
> *) there is no backslash command for getting a list of Roles (like \du &
> \dg for Users and Groups) - I'm considering using \dr for that - does
> that sound sensible ?

We could just recycle \du and/or \dg for the purpose.  If those should
still exist as separate commands, what should they do differently from
\dr?  There's no longer any hard-and-fast distinction ...

> *) the new connectionlimit code allows for negative Limits (beside -1)

Right now, any negative value is interpreted as "no limit".  I don't
feel a pressing need to change that.
        regards, tom lane


Re: psql and ROLES

From
Stefan Kaltenbrunner
Date:
Tom Lane wrote:
> Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:
> 
>>*) there is no backslash command for getting a list of Roles (like \du &
>>\dg for Users and Groups) - I'm considering using \dr for that - does
>>that sound sensible ?
> 
> 
> We could just recycle \du and/or \dg for the purpose.  If those should
> still exist as separate commands, what should they do differently from
> \dr?  There's no longer any hard-and-fast distinction ...

ok - that seems sensible - I will just reuse \du for this

> 
> 
>>*) the new connectionlimit code allows for negative Limits (beside -1)
> 
> 
> Right now, any negative value is interpreted as "no limit".  I don't
> feel a pressing need to change that.

ok - in that case we might consider changing the wording in the docs
from "-1 (the default) means no limit" to something like "any negative
value means no limit"


Stefan