I need to take a backup of my database via console / terminal (for academic reasons) but I get these errors, I have Debian Jessie and psql (PostgreSQL) 9.5.1.
... and voila, with that it will create a copy and to restore the copy. It's the same, you create the database and then execute these commands in CMD :
To execute
pg_dump
it you must do it outside the consolepsql
, that is, execute it directly in your terminal since it is a command like any other:For more information you can refer to the documentation:
For Windows you must define the PostgreSQL folder as environment variables . Then you must run the CMD and write these commands:
... and voila, with that it will create a copy and to restore the copy. It's the same, you create the database and then execute these commands in CMD :