Managed Postgres Clusters: pg_restore errors for superuser privileges

June 12, 2019 206 views
PostgreSQL

I'm trying to import a database with pg_restore to a managed postgres cluster but I get the following error:

could not execute query: ERROR: must be superuser to create an operator class

I'm connecting as "doadmin" which doesn't have superuser privileges, how can I connect as "postgres" user? or is there a way to pg_restore allowing the creation of operator class as admin user?

3 Answers
efox MOD June 12, 2019
Accepted Answer

Hey there,

At this time it isn't possible to create a superuser with DO Managed Databases; this bars operator class access as a superuser is always needed to create one.

We're learning more about Managed Databases every day and are always looking to improve the end-user experience. Should you want these to be implemented we'd love to hear your feedback on our IDEAS page. This is where our Product team looks to the community for ideas and use-cases that could be prioritized in future work cycles for us.

Regards,
Ethan Fox
Developer Support Engineer II - DigitalOcean

Thanks for the reply, but then how can I import a database in which some Operator Class are defined?

  • Hey there,

    You would need to remove the Operator Class from the data set before importing it to DO Managed Databases at this time. Could you clarify your use-case (either here or in an IDEA) so we can pass along the information to our Product team?

    Regards,
    Ethan Fox
    Developer Support Engineer II - DigitalOcean

I have a similar problem. I can't execute a Function because that has the statement 'SET sessionreplicationrole = replica' and only run by super privileges. Why DO can't give to us a superuser???
Let's try to help us resolve this problem.

Have another answer? Share your knowledge.