Aidan Mc Intosh
Aidan Mc Intosh

Reputation: 243

Postgres: pg_restore cmd not restoring the data in my database

I created a dump of my neon postgres db using this command: pg_dump -Fc -v -d <source_database_connection_string> -f <dump_file_name>. I renamed two of my misspelt columns in my prisma schema then proceeded to lose two columns of data due to a prisma db push command. My objective was to gain back this lost data using the pg_restore command. I tried changing the wrongly named columns in the feedback-upt.bak file to the updated names from my schema in notepad, then running the pg_restore command but that didn't work. I changed the columns back to their misspelt names in the backup.bak and re-ran the restore command but this didn't work either. Also note that I got these commands from neon.tech docs here: https://neon.tech/docs/import/import-from-postgres. This is what is returned in my bash:

$ pg_restore -v -d postgresql://xxxxxxxxx:[email protected]/xxxxxxx?sslmode=require feedback-upt.bak
pg_restore: error: input file is too short (read 0, expected 5)

Any help is greatly appreciated. The data that was lost was very essential.

Upvotes: 1

Views: 207

Answers (0)

Related Questions