I'm trying to dump a database and restore it. Running on windows 10, PostgreSQL 15.
I cannot wrap my head around the following:
This command creates a file that I cannot restore through pgadmin (pg_restore: error: input file does not appear to be a valid archive):
pg_dump -U postgres --blobs -Fc lusiadas > C:\mm\db_backup\lusiadas00.sql
This command creates a file that can be used in pg_restore (through pgadmin, same as above):
pg_dump --file C:\mm\db_backup\lusiadas0.sql -U postgres -Fc --blobs lusiadas
I've tried to do the same with a clean (empty) database (the "postgres" one that comes with the server), same results, so seems like the contents of the DB are not at fault. The plain format obviously works with both notations when restored with psql, only c and t are causing the problem.
pg_dump ... -f C:\mm\db_backup\lusiadas00.sql
instead. The there should be no problem restoring it usingpg_restore
.