I tried to run this in Codespaces:
createuser -W $user
but after entering password, the follow errors appear:
createuser: error: could not connect to database template1: FATAL: role "codespace" does not exist
I then tried:
psql -U postgres
but it errors:
psql: error: FATAL: Peer authentication failed for user "postgres"
I also tried:
sudo -u postgres psql
and it asks for sudo password, which I don’t know.