Databases
Repair ownership
Repair object ownership for supported legacy imports. Managed databases with protected roles use their grants manifest instead.
POST
Repair ownership
Repairs object ownership for a supported legacy database after a self-managed import. The agent refuses this operation on a managed database with a protected SQL Explorer role; that database requires the managed grants manifest path.
When to use this
Call this endpoint after you’ve imported a dump into a supported legacy database yourself (see Restore your own dump) and verified that an ownership mismatch causes the failure. Why it happens: A dump can carry object owners from the source server that differ from your DBHost owner role. Restores that DBHost runs from its own backups already end with this repair step. Use this endpoint for:- Clean-up after your own
psql/pg_restoreimport. - Databases restored before the automatic repair existed.
- A legacy import whose object owners differ from the database owner.
permission denied, check its explicit GRANT and default privileges in your migrations. Changing the owner role does not grant access to those app roles. DBHost managed restores use a separate manifest-backed repair path.
Path parameters
What it does
For a supported legacy target database only:ALTER SCHEMA public OWNER TO <owner>+ grantsUSAGE, CREATE.- Iterates every non-system schema and issues
ALTER TABLE/SEQUENCE/VIEW/MATERIALIZED VIEW ... OWNER TO <owner>. - Restores read access for the dashboard SQL Explorer on the affected tables.
Response
200 OK