I'm having a problem with an Amazon Linux (CentOs based) instance when trying to install the latest stable Postgres (version 9.3).
That version doesn't ships in the main repositories of that distro and I tried some of the RPM's that are available in the Postgres download site. CentOs and Fedora versions didn't worked, since they complained about the distro I'm using not to be the one they're made to. The Red Hat .rpm worked well and I could see the new packages available to yum.
I used the following:
wget http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm
rpm -Uvh pgdg-redhat93-9.3-1.noarch.rpm
So, I installed the Postgres packages of the version I'm interested in:
yum install postgresql93 postgresql93-devel postgresql93-server
So far, so good. Everything installed beatifully (just a php package conflicted, but I blew it up).
As said in every blog and help page, I initialized the database. For me, there is a need to change the PORT, so I did it in /etc/init.d/postgresql-9.3 script, changing the port to 5552, that is available in this box. To initialize and start the server, nothing new:
service postgresql-9.3 initdb
service postgresql-9.3 start
(the name of the service has the version, differently from the service installed from the mainstream amazon repositories)
It just works. I have no sign of problem until I tried to connect using psql utility:
[root@local]# su - postgres
-bash-4.1$ psql
psql: FATAL: role "postgres" does not exist
As usual, I also can't do it with root, but with the user "postgres" it seems reasonable that the role at least should have been created.
I can't use createdb for the same strange reason. I've been receiving the same error for any operation I try in the bin folder that could interact with the database. For that, Im stuck with a "working" database but no user able to connect to it.
When searching around the tips I could find are always related to a user trying to connect using the root user and the solution is to use postgres user and I'm doing it, as you saw.
This is a problem that just happened when trying the version 9.3. When I tried the repository package (that is still 9.2) it worked just fine. I could connect and test the database normally.
Before this package I tried to compile Postgres from source, but the hell of dependencies just didn't let me go.
Is there any other adjust I might be missing, some package that is needed or even a guess you could share to help me solve this issue?
service postgresql-9.3is not in itself a legal command, it must have had a ` start` after it?