Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support table and sequence ownership #4

Closed
zcmarine opened this issue Mar 27, 2018 · 1 comment
Closed

Support table and sequence ownership #4

zcmarine opened this issue Mar 27, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@zcmarine
Copy link
Contributor

Summary
At present pgbedrock manages ownership of schemas, but it does not support management of table or sequence ownership (with the exception of objects in personal schemas). This is strange and leaves ownership of these objects in kind of a no-man's land. Ideally pgbedrock should be able to support ownerships of all objects it configures permissions on.

One wrinkle to take into account is what happens if someone wants to own an object that is in a personal schema. We should disallow that.

Key Actions

  • Add tables and sequences keywords under the owns keyword
  • Determine whether it makes more sense to modify the SchemaAnalyzer class or just create a new class (NonSchemaAnalyzer?) given that if a non-schema object doesn't exist we can't create it + the functionality for determining ownership of schemas uses different queries than for other objects ownership. My gut feeling is that this should all be one class, but it's worth verifying
  • If the decision for the above is to make one class, then we should combine the Q_GET_ALL_NONSCHEMA_OBJECTS_AND_OWNERS, Q_GET_ALL_OBJECT_OWNERS, Q_GET_ALL_PERSONAL_SCHEMAS, and Q_GET_ALL_SCHEMAS_AND_OWNERS queries because let's be honest: it's weird that there's 4 different ways to get at very similar information (object + object owner).
  • Before processing, identify all desired personal schemas (likely using the spec_inspector.py discussed in the Provide multi-database support issue) and make sure that no desired object ownership is for an object in one of the personal schemas.
  • Modify pgbedrock generate to add ownership for tables and sequences to its output spec
@zcmarine
Copy link
Contributor Author

This has been added via PR #26. Closing this issue as complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant