Issue Summary
When browsing a Postgres data source, tables that have column-level select GRANTs are not being displayed because the table-level select GRANT is revoked.
Steps to Reproduce
- Revoke a table from SELECT
- Grant SELECT to certain columns
- Can query the table if you enter the SQL manually, but the table does not exist in the object browser.
Technical details:
- Redash Version: 26.3.0
- Browser/OS: N/A
- How did you install Redash: N/A
Solution:
Update get_tables to check column privilege in redash/query_runner/pg.py:
AND (
has_table_privilege(quote_ident(s.nspname) || '.' || quote_ident(c.relname), 'select')
OR has_column_privilege(quote_ident(s.nspname) || '.' || quote_ident(c.relname) , a.attname, 'select')
)
AND (
has_table_privilege(quote_ident(table_schema) || '.' || quote_ident(table_name), 'select')
OR has_column_privilege(quote_ident(table_schema) || '.' || quote_ident(table_name), column_name, 'select')
)
Issue Summary
When browsing a Postgres data source, tables that have column-level select GRANTs are not being displayed because the table-level select GRANT is revoked.
Steps to Reproduce
Technical details:
Solution:
Update
get_tablesto check column privilege inredash/query_runner/pg.py: