I just switched workstations and installed openSUSE Tumbleweed and PostgreSQL 15 using the postgresql database repo.
Details: Kernel: 6.3.4-1-default arch: x86_64 bits: 64 Desktop: LXQt v: 1.3.0 Distro: openSUSE Tumbleweed 20230608
PostgreSQL 15.3 (http://download.opensuse.org/repositories/server:/database:/postgresql/openSUSE_Tumbleweed/x86_64/postgresql15-15.3-24.9.x86_64.rpm to be specific). All the PostgreSQL code is from that repo.
Things tried and failed:
Running initdb as root:
initdb: error: cannot be run as root initdb: hint: Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process.
Running it as myself didn't work, of course, since PostgreSQL doesn't know me from Adam.
Following the instructions on the openSUSE PostgreSQL page:
Changing the installed postgresql login privledges and attempting to su postgresql
-- it complained that su: user posgresql does not exist or the user entry does not contain all the required fields
I also tried to be clever and, as root, added:
local all kevin trust
to /var/lib/pgsql/data/pg_hba.conf
, which postgresql.service
disliked to the degree it threw a tantrum and refused to start until I commented out the offending line, and then started up again without a hicup.
Sort of beating my head against this one.
I also tried pgadmin4, but that has never worked AFAIK. Get some odd, seeming intractable, Python errors. I haven't even touched pip so it can't be my fault, this time.
I checked and all of the PostgreSQL packages are from the same repo.
I don't recall these problems when I have set it up before. I have screwed things up, but nothing that wasn't easily fixed.
Do I delete and recreate postgresql user?
What am I missing?
systemctl start postgresql.service
to bring it up initially. Then from root,sudo -u postgres psql
to access it. If that does not work, then you have borked the install.sudo -u postgres psql
sincepostgres
is the database superuser.