0

I have a group role that consists of around 1,000 users. Those users do not inherit group role permissions, and I would like to make them all inherit them instead.

What would be the way to do it without writing 1,000 lines of PostgreSQL code?

1 Answer 1

0

Use psql's \gexec and a metadata query:

SELECT format('ALTER ROLE %s INHERIT', member::regrole)
FROM pg_auth_members
WHERE roleid = 'groupname'::regrole \gexec

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.