Issue
i'm looking for setup a Rails Environment with Vagrant, for that purpose the box it's been provisioned through bash shell method and includes among others this line:
sudo -u postgres createuser <superuserusername> -s with password '<superuserpassword>'
but i'm getting a configuration error,
createuser: too many command-line arguments (first is "with")
can you help me with the correct syntax for create a Superuser with a password. Thanks
Solution
Solved with:
sudo -u postgres createuser -s -i -d -r -l -w <<username>>
sudo -u postgres psql -c "ALTER ROLE <<username>> WITH PASSWORD '<<password>>';"
I know is not an elegant solution, but for now it'll do 😊
Answered By - Joseph Palmezano Answer Checked By - Katrina (WPSolving Volunteer)