I am using dotConnect to connect to Postgres in my vb.net project. If anyone using this then provide a method to backup and restore using pgdump
in a custom format i.e. mydatabase.backup
, i have tried pgdump
to backup but its backups the DB in .dmp so that I cannot restore this to Postgres via pgAdmin.
Asked
Active
Viewed 1,472 times
0

Liath
- 9,913
- 9
- 51
- 81
-
Show the command line you used for `pg_dump`. What does dotConnect have to do with this? PgAdmin-III can restore a `-Fc` ("custom format") dump from `pg_dump` just fine; in fact, when you make a backup from PgAdmin-III it's just running `pg_dump` anyway. Plain SQL dumps are restored with `psql` instead. – Craig Ringer Jan 30 '14 at 08:48
2 Answers
0
pg_dump and pg_restore are the server commands. They back up and restore data using the specific file format. dotConnect for PostgreSQL does not use these commands.
The PgSqlDump class backs up data to a script, based on metadata. This script can be performed in pgAdmin as a usual SQL script. PgSqlDump.Restore restores data based on the script.
For more information, please refer to this topic

Devart
- 119,203
- 23
- 166
- 186
0
This is what I would do to backup my old database and restore
To back up your database
pg_dump --format=c olddb_name > db_dump_file.dump
To restore that backup
pg_restore -v -d newdb_name db_dump_file.dump
Read more on pg_dump and pg_restore

Techie
- 44,706
- 42
- 157
- 243