I tried your method of logging into psql then using password and another time by alter statement.
psql
password
alter