Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
All solutions
    • All solutions for Managed Service for PostgreSQL
    • Restoring a Managed Service for PostgreSQL cluster after running out of free storage space
    • You are unable to delete your Managed Service for PostgreSQL cluster in the `DEAD` status if it has deletion protection enabled
    • Managed Service for PostgreSQL cluster switches to `UNKNOWN` once created
    • Resolving issues with updating configurations of clusters with `local-ssd` disks
    • Resolving the issue of cluster storage overflow with WAL logs
    • Resolving the `psql error could not translate host name to address nodename nor servname provided, or not known` error
    • Resolving the `Unrecognized configuration parameter stats_temp_directory` error
    • Resolving the `max_connections conn_limit is too high` error
    • Resolving the `Must be superuser to create this extension` error
    • Fixing the `terminating connection due to administrator command` and `ERROR: odyssey: remote server read/write error` errors
    • Resolving the `422 UNPROCESSABLE ENTITY The specified extension <'ext_name'> is not present in shared_preload_libraries` error
    • How `Conn limit` works
    • How to set up SQL query filtering
    • How to enable SQL query logging

In this article:

  • Issue description
  • Solution
  • When the error appears when restoring the dump
  1. Managed Service for PostgreSQL
  2. Resolving the `Must be superuser to create this extension` error

Fixing the Must be superuser to create this extension error

Written by
Yandex Cloud
Updated at December 17, 2025
  • Issue description
  • Solution
    • When the error appears when restoring the dump

Issue descriptionIssue description

You get the Must be superuser to create this extension error when:

  • You are trying to install a PostgreSQL extension.
  • You are restoring a database from dump using pg_restore.

SolutionSolution

In Managed Service for PostgreSQL, you do not get superuser permissions for the cluster security reasons. Managed Service for PostgreSQL manages certain operations on its own; it also replicates data across hosts, where any user interference may cause the cluster to fail. You can view the full list of such limits here.

Thus, you can only install extensions through the cloud console, CLI, or API. For the full list of supported extensions, see this article on managing extensions.

When the error appears when restoring the dumpWhen the error appears when restoring the dump

For restoring from a non-text archive, follow the steps below:

1. Get the list of objects to restore:

pg_restore -l <path to archive> > restore.list

2. In the restore.list file you get, comment out or delete the lines that refer to EXTENSIONS, such as CREATE EXTENSION ....

3. Run recovery using the list you just edited:

pg_restore --use-list restore.list ...

To restore dump from a text archive, do the following:

1. Check whether the dump has any requests for creating extensions:

grep "CREATE EXTENSION" dump.sql

2. Copy the dump to a new file, and then comment out or delete all requests for creating extensions:

cp dump.sql dump_edited.sql
sed -i 's/CREATE EXTENSION/-- CREATE EXTENSION/g' dump_edited.sql

3. Restore the dump:

psql -h <host> -p 6432 -U <user> -d <database> -f dump_edited.sql

Was the article helpful?

Previous
Resolving the `max_connections conn_limit is too high` error
Next
Fixing the `terminating connection due to administrator command` and `ERROR: odyssey: remote server read/write error` errors
© 2025 Direct Cursus Technology L.L.C.