I have to run a simulation with several postgresql databases spread on different machines which all of them are running linux.
I successfully compiled and built postgresql from the source code and I can also run the server, but when I try to create a new db with this command:
./postgresql/bin/createdb db1
I get this error:
createdb: could not connect to database postgres: FATAL: role "giulio" does not exist
where giulio is my username to access all the machines.
On some machine it works while on other it does not. I really cannot figure out the root of the problem. I suppose it is something related with the access control of postgres.
I did several research on google but I was not able to found and to solve the problem.
Does anyone know how to get this work?
Thanks,
-Giulio
I would assume that on the machines where the user “giulio” is already known, you executed
initdbwith exactly this user making him the DB superuser. A quote frominidb(1)(emphasis mine):On the other machines I assume you did execute
initdbwith another user, hopefully usingpostgres.In order to get back on the standard track I propose, that you delete the database cluster on the machines where “giulio” is the superuser and setup a new database cluster using the standard
postgresuser. Then add another user “giulio”. This will avoid more confusion down the road as some scripts/programs expect a superuser account namedpostgres.