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?