Home > Mobile >  Postgres SQL Restore Permission denied to create and alter database
Postgres SQL Restore Permission denied to create and alter database

Time:09-30

I had a backup of my Mayan-EDMS database which is stored in file.sql. I am trying to restore it. While I am restoring the database using psql -h 127.0.0.1 -U mayan -d mayan -W -f file.sql I got error that saying psql:file.sql:23: ERROR: permission denied to create database. How to remedy this problem?

CodePudding user response:

You have to modify the role mayan:

ALTER ROLE mayan CREATEDB;

Then it can create a database. Perhaps other aspects of restoring the database, like creating an extension, will require still higher privileges.

  • Related