0

I'm going to upgrade postgreSQL from the version 9 to 11. I've exported a database using this command C:\Program Files\PostgreSQL\11\bin\pg_dump.exe --file "C:\\Users\\bnechmi\\DOCUME~1\\db_kd" --host "myhost.com" --port "5450" --username "sce" --no-password --verbose --format=t --blobs --no-tablespaces "kd5"

On the linux server "myhost.com", postgreSQL 9 is installed.

On my new server I have installed postgreSQL 11. I created new database called kd5 then I imported the database using this command pg_restore -h localhost -d kd5 -U postgres ./mypath/db_kd --no-tablespaces --verbose 2>log1126.log

this is the contend of the file log1126.log

pg_restore: creating ACL "kd5.TABLE version"
pg_restore: creating ACL "kd5.TABLE version_bdgeo"
pg_restore: creating ACL "kd5.TABLE version_ihm"
pg_restore: creating ACL "kd5.TABLE version_suroit"
pg_restore: creating ACL "kd5.TABLE zone_tarifaire"
WARNING: errors ignored on restore: 476

Then I have connected to the database kd5, when I run the command \dt I get the message Did not find any relations

How can I import the exported database ?

  • Did `pg_restore` show any message? As which user are you connecting to the new `kd5`? If you connect as exactly the same user to the old `kd5` and type `\dt`, you get different results? – Antonis Christofides Jun 09 '22 at 09:10
  • BTW, unless you have a specific reason for using `--format=t`, it seems to be that `--format=c` should be better. – Antonis Christofides Jun 09 '22 at 09:11
  • pg_restore did not show any message. – mourad semi Jun 09 '22 at 09:12
  • the same with --format=c, "Did not find any relation" and pg_restore did not show any message. – mourad semi Jun 09 '22 at 09:21
  • @AntonisChristofides I've updated my post, I added the option --verbose 2>log1126.log to pg_restore to get the trace of this commande – mourad semi Jun 09 '22 at 09:31
  • You should mention this is a follow to this question [Export database](https://stackoverflow.com/questions/72552377/export-a-postgresql-database#comment128163421_72552377). 1) Did you restore the roles from the 9 to the 11 cluster? 2) In your previous question user `sce` did not the necessary privileges to do a complete data dump, does that role now have the privileges? Probably best to use the role `postgres` for both the dump and restore. 3) The `pg_restore` did have issues: `WARNING: errors ignored on restore: 476`. Want to make a bet they are about missing roles/insufficient privileges. – Adrian Klaver Jun 09 '22 at 15:52
  • I've created all roles – mourad semi Jun 09 '22 at 15:56
  • 1) You do not show that in your question. When did you create the roles? 2) Provide answers to the rest of the questions. – Adrian Klaver Jun 09 '22 at 16:03

0 Answers0