1

I have database backup in format: dump.sql.gz (and chmod 777 on it)

I need to restore in another server

I logged via postgres and:

createdb newdb
gunzip < dump.sql.gz | psql newdb

All is going well, but at one moment I got this errors:

SET
SET
SET
CREATE EXTENSION
COMMENT
SET
SET
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
...
ALTER TABLE
CREATE INDEX
...
GRANT
GRANT
ERROR:  permission denied for table categories
ERROR:  permission denied for table categories
ERROR:  permission denied for table categories
...

And after it restoring ends.

UPDATE:

from TOC entry 14923; 0 703831 MATERIALIZED VIEW DATA view_products myuser
pg_restore: error: could not execute query: ERROR:  permission denied for table categories
Command was: REFRESH MATERIALIZED VIEW public.view_products;

What's going wrong? Please help

  • 3
    You are not running `psql` with as database user with sufficient privileges to create table categories. Since you did not supply ` -U some_name` `psql` will run as the system user in effect where you ran the command. Use `-U super_user` to the command where super_user is replaced with a database user with sufficient privileges. – Adrian Klaver Dec 13 '20 at 16:42
  • 1
    You have to figure out the statement that creates the first error and debug that. – Laurenz Albe Dec 14 '20 at 07:50

0 Answers0