snippetsqlMinor
How to restore a .backup file from a single table on postgres?
Viewed 0 times
filepostgrestablesinglehowfromrestorebackup
Problem
I have a .backup dump from a single table, but it didn't work restore like a normal backup from an entire db. I'm creating this backup file with the following batch script
bin\pg_dump -h localhost -p 5432 -U postgres -F c -b -v -f %BACKUP_FILE% --table And i'm restoring it with the pgadmin restore option, i didn't get any error message, the restore run normally, but the table don't show on my db/schema.Solution
I am not sure what you tried so far, please post error message for better understanding,
Try below and post a comment if this works for you or not.
you can use pg_restore to restore a single table :
If the dump is not too big, the easiest thing to do is restore the full backup to a temporary database
Try below and post a comment if this works for you or not.
you can use pg_restore to restore a single table :
pg_restore -t my_table -d database_name database.dumpIf the dump is not too big, the easiest thing to do is restore the full backup to a temporary database
(gzcat backup_file.gz | psql -h host -U user database_name) dump the one table (pg_dump -t my_table), then restore it.Context
StackExchange Database Administrators Q#251169, answer score: 3
Revisions (0)
No revisions yet.