SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[postgresq] SA limited functionality for non-superusers

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[postgresq] SA limited functionality for non-superusers
Author Message
michalk



Joined: 29 Aug 2014
Posts: 211

Post [postgresq] SA limited functionality for non-superusers Reply with quote
Schemas SQL Query for postgresql 9.1 unnecessarily references pg_catalog.pg_authid.
This table, because contains hashed passwords is readable only by superadmin roles.

Unfortunately attempt to access this table by non-superadmin user ends with exception, therefore effectively disable all intellisense SA functionality.

The fix is trivial: replace pg_authid with pg_roles.
pg_catalog.pg_roles is a view over pg_authid, with exception, it hides hashed passwords with asterisks.
Final SQL looks as follow:

Code:

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_roles


Now every user can use SA or SA Editor
Fri Apr 27, 2018 11:37 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6750

Post Reply with quote
Thank you very much again. I have submitted a high priority ticket for this one, reference #SA0033733
Fri Apr 27, 2018 1:20 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.