I am trying to install PostgreSQL 9.3.5 on OpenSUSE 13.2 via software manager but when I shall create a user I get the following error:
createuser: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?
I can not start the service either with: “sudo service start postgresql”
The install went fine and I have tried restarting the computer. According to tutorials it should be a pretty straight forward task to install PostgreSQL. What am I doing wrong?!?
I have never used PostgreSQL myself. But you do have to start the service first indeed (or make it start automatically at boot by “enabling” the service).
I can not start the service either with: "sudo service start postgresql"
Try “sudo systemctl start postgresql” instead.
Then check whether it’s running with “sudo systemctl status postgresql”, if the start failed this might also give a clue why.
If starting works, make it start automatically on boot with “sudo systemctl enable postgresql”.
You can also use YaST->System->Services Manager for all of that.
Yes, thanks. But there is no service called postgresql in the Services Manager either. Have I forgot to install something? According to tutorials it should be enough to mark postgresql packages in Software Manager and then create a user for the DB.
Postgre is a bit of an oddity and that may contribute to its lack of documentation, I normally don’t even use it because MariaDB 10.x and MySQL 5.6+ offer essentially the same performance and scalability for most applications and have better documentation and community support.
For most use cases I would just advice people to go for MariaDB unless they have a very specific need.
Postgre is a bit of an oddity and that may contribute to its lack of documentation, I normally don’t even use it because MariaDB 10.x and MySQL 5.6+ offer essentially the same performance and scalability for most applications and have better documentation and community support.
For most use cases I would just advice people to go for MariaDB unless they have a very specific need.
No, the only way that worked was to use the rcpostgresql command. There is a file called postgresql in /etc/init.d/ but it seems OpenSUSE has mixed up the services for some reason.
Maybe, but the official PostgreSQL documentation is **** and only references to Ubuntu which happens to be common these days. For example, it took me a while to figure out the installation location which is /usr/local/pgsql according to the official documentation but in OpenSUSE it is /var/lib/pgsql/. It is very confusing…
Yes, the reason I need PostgreSQL is because I am setting up an Odoo ERP server for evaluation, that is going to be the next headache! There are much more documentation how to set up a LAMP server in OpenSUSE but that is not interesting for me. There are also better tutorials for Ubuntu and Red Hat but I prefer SUSE in an enterprise server for several reasons.
Hm?
Why do you think openSUSE has mixed up anything?
rcpostgresql is just a symlink to /etc/init.d/postgresql, i.e. you actually run “/etc/init.d/postgresql start”.
Still, as systemd supports old-style init scripts in /etc/init.d/, “systemctl start postgresql” should work as well.
If not, there’s a bug somewhere.
What error message do you get when you run “sudo systemctl start postgresql”?
As I said, I never used PostgreSQL myself, nor did I ever install it.
Maybe, but the official PostgreSQL documentation is **** and only references to Ubuntu which happens to be common these days. For example, it took me a while to figure out the installation location which is /usr/local/pgsql according to the official documentation but in OpenSUSE it is /var/lib/pgsql/. It is very confusing…
So you are talking about the official PostgreSQL documentation?
Well, I don’t think anybody here can help with that…
Btw, it probably would end up in /usr/local/pgsql, if you would compile PostgreSQL from source yourself (with the default options).
But a distribution (well, openSUSE at least) does not use /usr/local/ at all, as this is intended for local stuff, i.e. things the admin installs on this local installation.
You can inspect what files a package contains (and where they are installed) by selecting the package in YaST->Software Management and clicking on “File list” below the package list, or run “rpm -ql xxx” (where xxx is the name of the package).