0

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?

3
  • You should only need to run 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. Commented Jun 11, 2023 at 10:05
  • You are correct, that is all I should have to do. It doesn't not, however, suffice, as PostgreSQL is quite particular about separation of responsibilities between the sysadmin and DBA. I think this is a very good, if not essential, security measure-- except when the only user of the database is the person whose desktop it is installed in.
    – DrKC
    Commented Jul 20, 2023 at 19:24
  • You are incorrect. The DB does not get installed via any person of any desktop. If you installed it via yast then it will always be available by doing sudo -u postgres psql since postgres is the database superuser. Commented Jul 21, 2023 at 17:27

0

You must log in to answer this question.

Browse other questions tagged .