trying to install postgresql and pgadmin

I followed this tutorial on how to get postgresql and pgadmin installed. When it comes to the server part, I don’t see any servers in pgadmin.

looking at directly installing rpm here. Installing that through Discover, I get error “Dependency resolution failed”.

Not sure if there’s and easier about doing this?

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.

https://forums.opensuse.org/showthread.php/533714-Postgresql?p=2885264#post2885264

TSU

Thank you for the link. I followed your tutorial but to install Postgresql 11. This is what I got:

**#** zypper in -f ]postgresql11 postgresql11-docs postgresql11-te
st
Loading repository data...
Reading installed packages...
Forcing installation of 'postgresql11-docs-11.1-2.1.noarch' from repository 'PostgreSQL'
.
Forcing installation of 'postgresql11-test-11.1-2.1.x86_64' from repository 'PostgreSQL'
.
Package ']postgresql11' not found.
Resolving package dependencies...

The following 8 NEW packages are going to be installed:
  postgresql postgresql11 postgresql11-docs postgresql11-server postgresql11-test
  postgresql-docs postgresql-server postgresql-test

The following 3 recommended packages were automatically selected:
  postgresql11 postgresql11-docs postgresql11-server

8 new packages to install.
Overall download size: 9.4 MiB. Already cached: 0 B. After the operation, additional
54.0 MiB will be used.
**Continue? [y/n/...? shows all options] (y): **y
Retrieving package postgresql-11-4.3.noarch        (1/8),  11.6 KiB (  713   B unpacked)
Retrieving: postgresql-11-4.3.noarch.rpm .........................................[done]
Retrieving package postgresql11-docs-11.1-2.1.noarch
                                                   (2/8),   2.4 MiB ( 17.7 MiB unpacked)
Retrieving: postgresql11-docs-11.1-2.1.noarch.rpm ..................[done (448.0 KiB/s)]
Retrieving package postgresql11-11.1-2.1.x86_64    (3/8),   1.5 MiB (  6.5 MiB unpacked)
Retrieving: postgresql11-11.1-2.1.x86_64.rpm .......................[done (335.0 KiB/s)]
Retrieving package postgresql-docs-11-4.3.noarch   (4/8),  10.9 KiB (   83   B unpacked)
Retrieving: postgresql-docs-11-4.3.noarch.rpm ....................................[done]
Retrieving package postgresql-server-11-4.3.noarch (5/8),  19.2 KiB (  4.5 KiB unpacked)
Retrieving: postgresql-server-11-4.3.noarch.rpm ..................................[done]
Retrieving package postgresql11-server-11.1-2.1.x86_64
                                                   (6/8),   4.3 MiB ( 19.4 MiB unpacked)
Retrieving: postgresql11-server-11.1-2.1.x86_64.rpm ................[done (628.7 KiB/s)]
Retrieving package postgresql-test-11-4.3.noarch   (7/8),  10.6 KiB (   83   B unpacked)
Retrieving: postgresql-test-11-4.3.noarch.rpm ....................................[done]
Retrieving package postgresql11-test-11.1-2.1.x86_64
                                                   (8/8),   1.2 MiB ( 10.3 MiB unpacked)
Retrieving: postgresql11-test-11.1-2.1.x86_64.rpm ..................[done (462.4 KiB/s)]
Checking for file conflicts: .....................................................[done]
(1/8) Installing: postgresql-11-4.3.noarch .......................................[done]
Additional rpm output:
warning: /var/cache/zypp/packages/PostgreSQL/noarch/postgresql-11-4.3.noarch.rpm: Header
 V3 DSA/SHA1 Signature, key ID 05905ea8: NOKEY                                          


(2/8) Installing: postgresql11-docs-11.1-2.1.noarch ..............................[done]
Additional rpm output:
warning: /var/cache/zypp/packages/PostgreSQL/noarch/postgresql11-docs-11.1-2.1.noarch.rp
m: Header V3 DSA/SHA1 Signature, key ID 05905ea8: NOKEY                                 


(3/8) Installing: postgresql11-11.1-2.1.x86_64 ...................................[done]
Additional rpm output:
warning: /var/cache/zypp/packages/PostgreSQL/x86_64/postgresql11-11.1-2.1.x86_64.rpm: He
ader V3 DSA/SHA1 Signature, key ID 05905ea8: NOKEY                                      


(4/8) Installing: postgresql-docs-11-4.3.noarch ..................................[done]
Additional rpm output:
warning: /var/cache/zypp/packages/PostgreSQL/noarch/postgresql-docs-11-4.3.noarch.rpm: H
eader V3 DSA/SHA1 Signature, key ID 05905ea8: NOKEY                                     


(5/8) Installing: postgresql-server-11-4.3.noarch ................................[done]
Additional rpm output:
warning: /var/cache/zypp/packages/PostgreSQL/noarch/postgresql-server-11-4.3.noarch.rpm:
 Header V3 DSA/SHA1 Signature, key ID 05905ea8: NOKEY                                   
Updating /etc/sysconfig/postgresql ...                                                  


(6/8) Installing: postgresql11-server-11.1-2.1.x86_64 ............................[done]
Additional rpm output:
warning: /var/cache/zypp/packages/PostgreSQL/x86_64/postgresql11-server-11.1-2.1.x86_64.
rpm: Header V3 DSA/SHA1 Signature, key ID 05905ea8: NOKEY                               


(7/8) Installing: postgresql-test-11-4.3.noarch ..................................[done]
Additional rpm output:
warning: /var/cache/zypp/packages/PostgreSQL/noarch/postgresql-test-11-4.3.noarch.rpm: H
eader V3 DSA/SHA1 Signature, key ID 05905ea8: NOKEY                                     


(8/8) Installing: postgresql11-test-11.1-2.1.x86_64 ..............................[done]
Additional rpm output:
warning: /var/cache/zypp/packages/PostgreSQL/x86_64/postgresql11-test-11.1-2.1.x86_64.rp
m: Header V3 DSA/SHA1 Signature, key ID 05905ea8: NOKEY                                 


Executing %posttrans scripts .....................................................[done]
Installation has completed with error.


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.

TSU

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.


Please list your repositories with the following command.
It’s likely that you either do not have the OSS repository installed or it’s disabled.

zypper lr -d

TSU

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.

TSU

 zypper lr -d
# | Alias               | Name                        | Enabled | GPG Check | Refresh | 
Priority | Type   | URI                                                                 
               | Service
--+---------------------+-----------------------------+---------+-----------+---------+-
---------+--------+---------------------------------------------------------------------
---------------+--------
1 | adobe               | adobe                       | Yes     | ( p) Yes  | Yes     | 
  99     | rpm-md | http://linuxdownload.adobe.com/linux/x86_64/                        
               |         
2 | openSUSE-20181116-0 | openSUSE-20181116-0         | No      | ----      | ----    | 
  99     | rpm-md | hd:///?device=/dev/disk/by-id/usb-ADATA_USB_Flash_Drive_129270053232
00AA-0:0-part2 |         
3 | packman             | packman                     | Yes     | (r ) Yes  | Yes     | 
  90     | rpm-md | http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ 
               |         
4 | repo-debug          | openSUSE-Tumbleweed-Debug   | No      | ----      | ----    | 
  99     | NONE   | http://download.opensuse.org/debug/tumbleweed/repo/oss/             
               |         
5 | repo-non-oss        | openSUSE-Tumbleweed-Non-Oss | Yes     | (r ) Yes  | Yes     | 
  99     | rpm-md | http://download.opensuse.org/tumbleweed/repo/non-oss/               
               |         
6 | repo-oss            | openSUSE-Tumbleweed-Oss     | Yes     | (r ) Yes  | Yes     | 
  99     | rpm-md | http://download.opensuse.org/tumbleweed/repo/oss/                   
               |         
7 | repo-source         | openSUSE-Tumbleweed-Source  | No      | ----      | ----    | 
  99     | NONE   | http://download.opensuse.org/source/tumbleweed/repo/oss/            
               |         
8 | repo-update         | openSUSE-Tumbleweed-Update  | Yes     | (r ) Yes  | Yes     | 
  99     | rpm-md | http://download.opensuse.org/update/tumbleweed/             

Simpler than you think:


zypper in postgresql pgadmin3

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.

TSU

I’m fine with 10. What do i need to do start fresh from the beginning?

Just follow my post #4, except substitute “postgresql10” for postgresql11
https://forums.opensuse.org/showthread.php/533935-trying-to-install-postgresql-and-pgadmin?p=2886980#post2886980

TSU

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.