I fixed the problem on my system,
postgres=# alter user my-sys with password 'pass11'; ERROR: syntax error at or near "-" LINE 1: alter user my-sys with password 'pass11'; ^
Here is the problem
psql asks for input, and you again asked for a change, see postgres-# . Therefore, it gives an error when changing
postgres-# alter user "my-sys" with password 'pass11'; ERROR: syntax error at or near "alter" LINE 2: alter user "my-sys" with password 'pass11'; ^
The solution is as simple as a mistake,
postgres=# alter user "my-sys" with password 'pass11'; ALTER ROLE
Atul arvind
source share