Thanks for the script - but I have following error after install postgresql
yarn is already the newest version (1.22.5-1).
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgresql is already the newest version (12+214ubuntu0.1).
postgresql-contrib is already the newest version (12+214ubuntu0.1).
postgresql-server-dev-all is already the newest version (214ubuntu0.1).
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
postgres@cv002250:~$
After that the script stops. When i input “exit” the script is continue but not working anymore
postgres@cv002250:~$ exit
logout
createuser: error: could not connect to database template1: FATAL: role "root" does not exist
createdb: error: could not connect to database template1: FATAL: role "root" does not exist
psql: error: FATAL: role "root" does not exist
./gistfile1.sh: 32: create: not found
./gistfile1.sh: 33: grant: not found
./gistfile1.sh: 34: create: not found
./gistfile1.sh: 35: q: not found
administrator@cv002250:~$
What is the right way - or what I doing wrong?