Need help on creating a linux script that allows me to create a postgresql user with password based on the following variables:
PG_USER="username"
PG_PWD="password"
Usually I have to do it manually, but need a script based on the following code (include the flags on the script):
createuser --createdb --username postgres --no-createrole --no-superuser
Based on the above code, need a script that allows me to include the flags and also include the username and password variables.
createuserutility. Consider to use~ $ PGPASSWORD=123 psql -U postgres -h localhost -c "create role $PG_USER ..."or something...