How can I setup a new user, password and database all in one command for my PostgreSQL database? I have a test script that needs to run a command to setup a database. This is what I have tried:
psql -h localhost -U root
but this asks me to enter a password, is there a way to do it on one command i.e.
psql -h localhost -U root -P '123' - database
Where the password and new database is created?