SyntaxFix
Write A Post
Hire A Developer
Questions
You can do it in your batch file by parsing the output of:
SELECT * FROM pg_user WHERE usename = 'my_user'
and then running psql.exe once again if the role does not exist.
psql.exe