Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

385
Vistas
Restore postgres schema from .sql dump file without role and/or permissions?

I receive the following error when attempting to restore a postgres database schema from an .sql dump file created on another server:

REVOKE psql:backup.sql:158885: ERROR: role "server_name" does not exist

The dump file was created using pg_dump -U username "server_name" -n schema_name > schema_name.sql

How can I create a dump file without role and/or permissions?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

By utilizing the flags --no-owner and --no-acl

Do not output commands to set ownership of objects to match the original database. By default, pg_restore issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created schema elements. These statements will fail unless the initial connection to the database is made by a superuser (or the same user that owns all of the objects in the script). With -O, any user name can be used for the initial connection, and this user will own all the created objects.

Prevent restoration of access privileges (grant/revoke commands):

pg_dump --no-owner --no-acl -U username "server_name" -n schema > schema.sql

https://www.postgresql.org/docs/9.2/static/app-pgrestore.html

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda