You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The postgres profile has an optional search_path configuration to override the search_path. I would like an optional role configuration to override the user. It would use the set role command before any operations.
This would be useful because objects would be created with the correct ownership and permissions, instead of needing hooks at the end to grant ownership and permissions to created objects.
Describe alternatives you've considered
Grant ownership and permissions via hooks.
Additional context
This feature is only relevant to Postgres.
Who will this benefit?
This will benefit anyone using role-based access control in Postgres.
For example, I have three roles in my data warehouse: dwadmin, dwloader, and dwclient. Each role has multiple users, and a user can have multiple roles granted to them. When operating on the data warehouse, first the user sets their role, and then performs the operation with appropriate permissions.
Currently, dbt runs as a user and has to grant ownership and permissions to the roles at the end of the run. I would like for dbt to run as a given role instead, so ownership and permissions are correct when the objects are created.
The text was updated successfully, but these errors were encountered:
This is a cool idea @mpcogito. We don't typically use postgres as an analytical database, so I'm not deeply familiar with role-based access control on pg. Do you think this is as easy as running set role ... every time a connection is opened? I imagine this would be more tractable to support as a profile-level config, not as a model-level config. Does that sound appropriate to you?
I think this would work for Redshift as well since its permission model is similar to Postgres, but I never did get Redshift permissions working to my satisfaction!
Describe the feature
The postgres profile has an optional search_path configuration to override the search_path. I would like an optional role configuration to override the user. It would use the
set role
command before any operations.This would be useful because objects would be created with the correct ownership and permissions, instead of needing hooks at the end to grant ownership and permissions to created objects.
Describe alternatives you've considered
Grant ownership and permissions via hooks.
Additional context
This feature is only relevant to Postgres.
Who will this benefit?
This will benefit anyone using role-based access control in Postgres.
For example, I have three roles in my data warehouse: dwadmin, dwloader, and dwclient. Each role has multiple users, and a user can have multiple roles granted to them. When operating on the data warehouse, first the user sets their role, and then performs the operation with appropriate permissions.
Currently, dbt runs as a user and has to grant ownership and permissions to the roles at the end of the run. I would like for dbt to run as a given role instead, so ownership and permissions are correct when the objects are created.
The text was updated successfully, but these errors were encountered: