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?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

12 answers

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.

Ethan Fox
Developer Support Engineer II - DigitalOcean

  • I have a serious problem with that. Trying to import several csv files and got the error:
    defaultdb=> COPY XXXXXXXXX FROM ’/Users/laptop/Desktop/total.csv’ WITH (FORMAT csv);
    ERROR: must be superuser or a member of the pgreadserver_files role to COPY from a file
    HINT: Anyone can COPY to stdout or from stdin. psql’s \copy command also works for anyone.

    I tried everything and every answer from stackoverflow, and now you are telling me that it can’t be done?

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.

Seriously ? Releasing postgres managed DB without access to superuser ? What was the use case you were addressing when releasing this feature. And do you really expect everyone to manage things without a superuser ??

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?

    Ethan Fox
    Developer Support Engineer II - DigitalOcean

Having same issue too. And I’m sure that every single one who tried to use DO managed DB would experienced the same issue. We need superuser access to DB to actually using it. This is basic of basic. When does the superuser access going to be supported on DO?

Need superuser access! Why is this not supported by default? Really strange!

I need event triggers, replications and more. Nothing is accessible without superuser privileges. That’s some serious WTF moment.

Without superuser the managed DB feature is useless for Odoo ERP.

Is this still not solved?
I need superuser access.

Any news on this? We just had to switch gears and use something other than DO on a project using postgraphile because we can’t use it without being able to set up event triggers.

I also need superuser access…

This is pretty mad… Similar to others I need superuser access - can’t really see any logic for that not being possible. We’re just going to move the current project out of DO as a result.

Response to edit the data and remove superuser needs is a bit dismissive. It’s less work for me to switch DB provider for this project than it is to edit the masses of data I need to import.

Submit an Answer