I am trying to execute this
psql "user=postgres password=xxxx hostaddr=xxxx port=5432 dbname=xxx options='-f D:\scripts2\201804130713_test.sql'"
programmatically in order to run a change script on my database.
I am following the answer here that has 305 up-votes. How do I specify a password to psql non-interactively? for using the connection string.
The connection string works, but the file argument has all the slashes removed from the path. I don't know how to escape them, and various things I have tried has introduced problems with single quotes, etc. I think my approach may be off by quite bit. I just need a way to do this.