On 2024-05-30 10:07 +0200, Edwin UY wrote:
> Is createuser the only one I can use to create a user where it prompts for
> a password? There is no alteruser though.
> I want to use psql and \prompt but am lost on how to use it.
> Basically just want to use it for running a psql script like for example -
> ALTER USER spongebob WITH ENCRYPTED PASSWORD ':newpassword';
Or use \password which has the benefit of not leaking the plaintext
password into the logs which would be the case if there's an error in
the ALTER USER command.
psql -c '\password spongebob'
--
Erik