I have a project where a postgres db is seeded with a .sql file in the ci test server. This will be build and published as a docker image.
Now, I won't be the only one pushing these .sql files to the server. So I need to check permissions of all postgres users (and maybe future users) against all databases, introduced by this file.
Example: User A and B. User A is a superuser and owns all databases. User B should only read be able to read in database X. and so on
Is there a way to test this programmaticaly? Other than 'try to read as B from Y -> error?
All other solutions I've found so far are either manually or 'try/error' ones.