Question

As the title already says: What privileges are required to inherit from a table?

I want to create two schemas core and dev where core has a table named Companies with coreuser as its owner.

Another user, we call it devuser has all privileges to access the devschema. How can he inherit from the table core.Companies with as few privileges as possible, not even select privileges in the coreschema?

Was it helpful?

Solution

In order to create a table that inherits from core.companies, devuser must be the owner of core.companies. Also, devuser must have usage privileges on the schema "core".

I couldn't find this in the docs. I determined the answer through testing.

You might be able to work around this by having coreuser create child tables in the dev schema, then either grant privileges to devuser or change ownership to devuser. I think devuser will need some privileges on core.companies in order to update data, but I could be wrong.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top