Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

How to resolve an error related to pg_dump?

Asked by Daniel Baker Sep 29, 2022 1.3K views 1 answer
Share

About this question

 I'm trying to restore a dump without having the appropriate roles on the receiving database.

As mentioned here but also here, you need to have the --no-owner as an option, either in pg_dump or pg_restore or both.

I've used the following command line to create my dump:

"C:Prrogram FilesPostgreSQL9.3binpg_dump.exe" --no-owner -Ft --dbname=postgresql://avo******:AV0******?@127.0.0.1:5432/BI_DB > K:BIbackupsortbck_%timestamp%.tar

The restoring line is as follows:

"C:Program FilesPostgreSQL9.3binpg_restore.exe" --host localhost --port 5432 --username "postgres" --dbname "BI_TEST2" --no-password  --no-owner --role=postgres --exit-on-error --verbose "D:Davobackupbck_04042017_1410.tar"

As you can see, both have the --no-owner option but eventually, I have the error below:

What terribly bugs me is the log below:

pg_restore: [programme d'archivage (db)] Erreur pendant le traitement de la TOC (« PROCESSING TOC ») :
pg_restore: [programme d'archivage (db)] Erreur à partir de l'entrée TOC 2633 ; 0 0 ACL adm avo******
pg_restore: [programme d'archivage (db)] could not execute query: ERREUR:  role « avo****** » does not exist

Why does it say it needs a role even if the --no-owner was specified?

Did I miss something?

I'm running on Postgres 9.3



Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.