Restoring pgsql dump file on window's command prompt

58 views Asked by At

I was trying to use psql command to restore a pgsql file to a newly created database using the following command:

psql -d xerus -f C:\Users\'Rishikesh Bhattacharya'\desktop\xerus_backup.pgsql

It threw the error that:

psql invalid command \

I think this error is because usually psql terminal commands begin with ''. So I tried to change the back slashes in path to the file, to forward slashes. It worked after that change.

psql -d xerus -f C:/Users/'Rishikesh Bhattacharya'/desktop/xerus_backup.pgsql

But I fail to understand how is it possible for the psql command to interact with OS, when this change is made?

0

There are 0 answers