pgadmin-org / pgadmin-org/pgadmin4

ACL SQLs should have single statement even if multiple roles used

Open
#6,231 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
Python
Stars
3.8k
Forks
891
Avg merge
4d 7h
Merged PRs (30d)
8

Description

Describe the bug

When an ACL is executed for multiple roles in a single statement, then the RE-SQL should also be a single statement

To Reproduce

Steps to reproduce the behavior:

  1. Create a view viewtest
CREATE VIEW public.viewtest
 AS
select * from pg_class;
  1. Execute the SQL assuming you have 2 roles - role1, role2:
GRANT UPDATE(oid) ON public.viewtest TO role1, role2;
  1. Go to SQL tab. It shows
GRANT UPDATE(oid) ON public.viewtest TO role1;
GRANT UPDATE(oid) ON public.viewtest TO role2;

Expected behavior
The RE-SQL should also be a single statement. Apart from view, other places table, mview should also be checked.

Screenshots
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the SQL tab output for a view using the multi-role GRANT shown in the issue, then trace the ACL SQL generation path. Done means the reverse SQL uses one statement with both roles and the same behavior is checked for tables and materialized views.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.