 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
[SA 9.1.276 Pro] - PG and $OBJECT()$ |
|
Why does the popup not show users(/roles/groups/whatever) in popup for $OBJECT(role)$ and show them for $OBJECT(login)$ (which actually seems to be a non-existent keyword in PostgreSQL)?
|
|
Sat May 27, 2017 1:25 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
My wild guess, that's because of SA cross-platform support and the need to bridge the "naming" differences between different db types. Roles in PG are like logins in other systems if they're not "group" type roles. There are no users and standalone user groups. Groups are roles too with group attribute.
|
|
Mon May 29, 2017 11:45 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Yes, that's reasonable as an explanation why it has roles in popup for $OBJECT(login)$, even if the term 'login' seems not to exist in PostgreSQL. What does not make sense, however, is why not show them for $OBJECT(role)$ as well, which is what they are actually called there. You're correct that roles in PG are like logins/users when used to login, but they also behave like roles in other systems when they lack the canlogin property and are used for permission management.
Not showing them for $OBJECT(role)$ is somewhat counter-intuitive, imho.
|
|
Mon May 29, 2017 2:28 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Your point is very reasonable. I'm going to enter this a n enactment request. Thank you very much for your feedback.
|
|
Mon May 29, 2017 3:57 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Thank you very much.
|
|
Mon May 29, 2017 4:42 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Please update "Schemas (PostgreSQL)" query in the option to the following
 |
 |
SELECT
nspname, 'SC', oid
FROM
pg_catalog.pg_namespace
WHERE nspname NOT LIKE 'pg\_%'
OR nspname = 'pg_catalog'
UNION ALL
SELECT
rolname, CASE WHEN rolcanlogin THEN 'SL' ELSE 'SR' END, oid
FROM
pg_catalog.pg_authid |
After this change $OBJECT(role)$ should show group roles only, excluding logins. To show all roles with login permissions, use $OBJECT(login,role)$
You can tweak the query further to meet your requirements. Here SC is used for traditional schemas and users, SR - for traditional roles, SL - for logins
|
|
Tue May 30, 2017 9:14 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
This is great, thank you very much.
|
|
Tue May 30, 2017 11:14 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|