[#987] Fixed how commands as other user is called
Merge pull request #979 from akvo/978_pg_script_fix

[#987] Fixed how commands as other user is called