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
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
tables
andsequences
keywords under theowns
keywordSchemaAnalyzer
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 verifyingQ_GET_ALL_NONSCHEMA_OBJECTS_AND_OWNERS
,Q_GET_ALL_OBJECT_OWNERS
,Q_GET_ALL_PERSONAL_SCHEMAS
, andQ_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).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.pgbedrock generate
to add ownership for tables and sequences to its output spec