-
Notifications
You must be signed in to change notification settings - Fork 796
Closed
Description
Version : 7.0 (same issue on 6.21 but not 6.20)
Application Mode : Desktop
NW.js Version : 0.72.0
Browser : Chromium 109.0.5414.87
Operating System : Windows-10-10.0.19042-SP0
Connecting on a PostgreSQL 14.7 database (running on Ubuntu 20.04.6)
We are getting an error since version 6.21 when we try to show the sql panel for a view which has column privileges for multiple users.
For the example bellow I can show the sql panel for the view my_schema.test1 but not from my_schema.test2 (it doesn't matter if I'm using a super user or not)
create or replace view my_schema.test1 as
SELECT col1,col2,col3
from my_schema.my_table;
grant update(col2,col3) on my_schema.test1 to "User1";
create or replace view my_schema.test2 as
SELECT col1,col2,col3
from my_schema.my_table;
grant update(col2,col3) on my_schema.test2 to "User1","User2";
There isn't any error on the database side but he following pgadmin log appears when the error occurs :
2023-04-26 14:12:19,975: ERROR pgadmin: 'privileges'
Traceback (most recent call last):
File "C:\Users\Tqueinnec\AppData\Local\Programs\pgAdmin 4\v7\python\lib\site-packages\flask\app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\Tqueinnec\AppData\Local\Programs\pgAdmin 4\v7\python\lib\site-packages\flask\app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "C:\Users\Tqueinnec\AppData\Local\Programs\pgAdmin 4\v7\python\lib\site-packages\flask\views.py", line 107, in view
return current_app.ensure_sync(self.dispatch_request)(**kwargs)
File "C:\Users\Tqueinnec\AppData\Local\Programs\pgAdmin 4\v7\web\pgadmin\browser\utils.py", line 311, in dispatch_request
return method(*args, **kwargs)
File "C:\Users\Tqueinnec\AppData\Local\Programs\pgAdmin 4\v7\web\pgadmin\browser\server_groups\servers\databases\schemas\views\__init__.py", line 263, in wrap
return f(*args, **kwargs)
File "C:\Users\Tqueinnec\AppData\Local\Programs\pgAdmin 4\v7\web\pgadmin\browser\server_groups\servers\databases\schemas\views\__init__.py", line 1479, in sql
sql_data += self.get_columns_sql(did, vid)
File "C:\Users\Tqueinnec\AppData\Local\Programs\pgAdmin 4\v7\web\pgadmin\browser\server_groups\servers\databases\schemas\views\__init__.py", line 1389, in get_columns_sql
parse_priv_to_db(res[row['deftype']], allowed_acls)
File "C:\Users\Tqueinnec\AppData\Local\Programs\pgAdmin 4\v7\web\pgadmin\browser\server_groups\servers\utils.py", line 122, in parse_priv_to_db
_parse_privileges(priv, db_privileges, allowed_acls, priv_with_grant,
File "C:\Users\Tqueinnec\AppData\Local\Programs\pgAdmin 4\v7\web\pgadmin\browser\server_groups\servers\utils.py", line 73, in _parse_privileges
_check_privilege_type(priv)
File "C:\Users\Tqueinnec\AppData\Local\Programs\pgAdmin 4\v7\web\pgadmin\browser\server_groups\servers\utils.py", line 51, in _check_privilege_type
if isinstance(priv['privileges'], dict) \
KeyError: 'privileges'