Although the following link is to installing PostgreSQL on 42.3,
The steps should apply to all versions of openSUSE.
Although installling from the OSS (default repo) should not make much a difference most of the time, there can be a difference infrequently.
The major difference of course is that you should be configured with Tumbleweed repos only, and no repos for any other version of openSUSE.
Remember to remove your existing postgresql packages before you remove the database repo, the User in the referenced thread didn’t do that, so had to manually search for, and purge those files manually.
Before anything else,
You had to undo the steps also described in the SDB to add a special database repo for PostgreSQL.
There is no need to add the special repository, your default OSS repository should also have PostgreSQL 11.
There is a slight difference between installing from each repo, the default repo I recommend is more tested while things you may install or update later from the special database repo can be less tested and more risky.
So,
You should first remove all your postgresql packages…The following command will likely do that
zypper rm 'postgres*'
Assuming you haven’t made any custom modifications to configuration files, you can take a chance at leaving them in place(Uninstalling packages almost always leave configuration files and do not remove them), otherwise you should follow the steps described in the referenced thread to identify remaining postgresql files on your system and remove them manually.
Then you should remove your database repository.
From what you posted, I’m guessing the following should do so
zypper rr PostgreSQL
Then, do a refresh so your system picks up the changes to your repositories
zypper ref
Now you can verify for yourself that your postgresql packages are still available for install with your remaining repositories
zypper se postgresql11 postgresql11-docs postgresql11-test
And then you can install. You can use the “-f” flag to force installing and over-writing any existing configuration files which I recommend to be ultra sure you shouldn’t have remnants from your previous install attempts
zypper in -f postgresql11 postgresql11-docs postgresql11-test
Your installation should complete without error, and then you can go back to the referenced thread for how to start your server and enable it to start automatically on boot.
zypper rm 'postgres*'
Loading repository data...
Warning: No repositories defined. Operating only with the installed resolvables. Nothing can be installed.
Reading installed packages...
Resolving package dependencies...
The following 8 packages are going to be REMOVED:
postgresql postgresql11 postgresql11-docs postgresql11-server postgresql11-test
postgresql-docs postgresql-server postgresql-test
8 packages to remove.
After the operation, 54.0 MiB will be freed.
Continue? [y/n/...? shows all options] (y): y
(1/8) Removing postgresql-docs-11-4.3.noarch .....................................[done]
(2/8) Removing postgresql11-test-11.1-2.1.x86_64 .................................[done]
(3/8) Removing postgresql11-docs-11.1-2.1.noarch .................................[done]
(4/8) Removing postgresql-test-11-4.3.noarch .....................................[done]
(5/8) Removing postgresql11-server-11.1-2.1.x86_64 ...............................[done]
(6/8) Removing postgresql-server-11-4.3.noarch ...................................[done]
(7/8) Removing postgresql11-11.1-2.1.x86_64 ......................................[done]
(8/8) Removing postgresql-11-4.3.noarch ..........................................[done]
There are some running programs that might use files deleted by recent upgrade. You may wish to check and restart some of them. Run 'zypper ps -s' to list these programs.
zypper rr PostgreSQL
# zypper rr PostgreSQL
Removing repository 'PostgreSQL' .................................................[done]
Repository 'PostgreSQL' has been removed.
zypper ref
# zypper ref
Repository 'adobe' is up to date.
Repository 'packman' is up to date.
Repository 'openSUSE-Tumbleweed-Non-Oss' is up to date.
Repository 'openSUSE-Tumbleweed-Oss' is up to date.
Repository 'openSUSE-Tumbleweed-Update' is up to date.
All repositories have been refreshed.
# zypper se postgresql11 postgresql11-docs postgresql11-test
Loading repository data...
Reading installed packages...
No matching items found.
zypper in -f postgresql11 postgresql11-docs postgresql11-test
# zypper in -f postgresql11 postgresql11-docs postgresql11-test
Loading repository data...
Reading installed packages...
Package 'postgresql11' not found.
Package 'postgresql11-docs' not found.
Package 'postgresql11-test' not found.
Resolving package dependencies...
Nothing to do.
Actually,
When I look at my own TW,
I don’t see PostgreSQL 11, the latest stable version is PostgreSQL 10.
So,
The question is whether you really want to try to install PostgreSQL 11, then you will need to install from an add-on repo.
Or, if you just want something that is stable and works, and don’t need anything special to 11, then you should install PostgreSQL as described in the referenced 42.3 link.
Yes, if @OP only wanted to install any working version of PostgreSQL but he was trying to install PostgreSQL 11 which is not in the OSS and may not be working right yet in the database repo.
Also, the additional packages I recommended would be for a full installation with documentation and more.
I installed postgresql fine (not pgadmin yet), but when I wanted to enable server, this is what i got:
** #** systemctl start postgresql
Job for postgresql.service failed because the control process exited with error code.
See "systemctl status postgresql.service" and "journalctl -xe" for details.
# systemctl status postgresql.service
● postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: >
Active: failed (Result: exit-code) since Fri 2018-11-23 21:13:08 EST; 9min ago
Process: 28920 ExecStart=/usr/share/postgresql/postgresql-script start (code=exited, >
Nov 23 21:13:08 linux-j3hv systemd[1]: Starting PostgreSQL database server...
Nov 23 21:13:08 linux-j3hv postgresql-script[28920]: postgres: could not access the ser>
Nov 23 21:13:08 linux-j3hv postgresql-script[28920]: pg_ctl: could not start server
Nov 23 21:13:08 linux-j3hv postgresql-script[28920]: Examine the log output.
Nov 23 21:13:08 linux-j3hv systemd[1]: postgresql.service: Control process exited, code>
Nov 23 21:13:08 linux-j3hv systemd[1]: postgresql.service: Failed with result 'exit-cod>
Nov 23 21:13:08 linux-j3hv systemd[1]: Failed to start PostgreSQL database server.