I'd like to restore the PostgreSQL database from a dump. The below command works fine for me:
CALL "%PGBIN%\pg_restore" -c -d NetCatalog %DUMPFILE%
How can I add a few lines to my .bat file to rename the existing NetCatalog to NetCatalog_Old and create a new database NetCatalog before calling the above line?
PS. Is there an argument that allows me to log the restoring process?