5
votes

What does it mean I'm trying to restore my postgresql db and here is what I'm getting but I do not see it restore tables/data/

C:\Program Files\PostgreSQL\9.4\bin\pg_restore.exe --host 123-97.compute-1.amazonaws.com --port 5432 --username "username" --dbname "mydb" --no-password --section pre-data --section data --section post-data --schema public --verbose "C:\db\employee.backup"

pg_restore: connecting to database for restore pg_restore: implied data-only restore

Process returned exit code 0.

I'm using Windows 8.1

2
What's in your backup file? Are you sure it has useful content? - tadman
i have backup on my local machine and the size of that is 100 mb yes its my database that i used for the application... i do not know much about postgresql db or pgadmin just stuck in pg_restore - Nick Kahn
You're using all the --section options, which is the same as not specifying any at all, however, the warning you're getting (implied data-only restore) points to some kind of problem there, so you'll be better off with removing all --section <type> options from your command. Also, you're requesting restoring only the public schema, is this what you actually want to do?. Note that if the public schema is empty in your database, then the restore will do nothing. - Ezequiel Tolnay

2 Answers

4
votes

I was getting this error while restoring schema backup with different name. When i restored the schema with same name it worked like a charm and then later I renamed it.

Alternative: do pg_restore from a carefully-restricted pg_dump dump and avoid --schema (and possibly even --table) options when using pg_restore.

0
votes

i faced same issue when tried to restore psql 12 backup into psql 12 database but with newer ubuntu version (backup was on ubuntu 18 and restore on ubuntu 20 ,both are psql 12). when i downgraded ubuntu from 20 to 18 it restored just normally, not sure why ubuntu version should make problem. my advice just make sure environment of backup and restore are exactly the same.