Restore Postgres Database

1

I have an application in c # I want to make the Backup and Restore from the same application in a postgres database, but here are several questions, for this I will use the command line.

  • Backup ok, now when doing the restoration it can be done on a db that has its tables created? to me it sends me error that already exists several constraints between other errors .. But when I do the restore with only the db created without tables the restoration is ok.
  • It depends on question 1, if to do the restore I need the db without tables, then I will not be able to do the restore from the application, since I will have to delete the tables from the existing database. Or there is some way to do it.
  • My commands:

    pg_dump.exe --host localhost --port 5432 --username postgres --format custom --blobs --verbose --file E:\test.backup pventa
    
    pg_restore.exe --host localhost --port 5432 --username postgres --dbname pventa --verbose E:\test.backup
    
        
    asked by Novato 28.12.2018 в 06:59
    source

    0 answers