-1

I'm on my way installing postgres 15.2 under Suse Linux Enterprise 15.3 by source, following the instructions from www.postgresql.org:

I'm stuck at chapter "19.2. Creating Database Cluster" (https://www.postgresql.org/docs/current/postgres-user.html)

root# mkdir /usr/local/pgsql
root# chown postgres /usr/local/pgsql
root# su postgres
postgres$ initdb -D /usr/local/pgsql/data

The postgres User (I'm looking for operating system user account") does not exist yet.

My question: how can I add the new postgres- system operation user account (with right permissions for postgreSQL)?

  • Important to know for postgreSQL: "PostgreSQL user accounts are distinct from operating system user accounts" (vgl. https://www.postgresql.org/docs/current/tutorial-createdb.html)

  • referring to MAN-Page text by default "the home directory will be created and the initial default files and directories will be copied."

  • I don't need a home-directory

  • I don't want to create the Database Cluster with my personal user-account

  • referring rights, as far as I guess from pg-documentation, the new user only needs full rights on usr/local/pgsql (I'm not that sure about this point)

TylerH
  • 20,799
  • 66
  • 75
  • 101
jui
  • 19
  • 4
  • The page you linked to (which is apparently not the one you *thought* you were linking to) tells you what to do. – jjanes Feb 24 '23 at 16:07
  • Nothing wrong with installing from source, but on suse/opensuse it's just bat .. bleep .. crazy.... I've used suse/opensuse since 7.0 Pro and currently have postgresql 15.3 happily running on Leap 15.4. The RPM install does the complete setup for you. As root just `zypper in postgresql15 postgresql15-contrib postgresql15-server` add `postgresql15-devel` if you want the C/C++ library and headers. (it may get pulled in anyway on a 'recommends' dependency) Just accept whatever the suggestions are. Works fine. Talks to Archlinux without a version mismatch. – David C. Rankin Jun 10 '23 at 23:11

3 Answers3

0

The page postgres-user.html mentions the required commands (useradd or adduser). Run useradd --help to see available options. They are also all mentioned in the referenced man page.

Maybe you are just confused by the text following Depending on the command line options. No home directory will be created unless -m is specified.

I think you are all set by just running useradd postgres.

olh
  • 170
  • 10
0

With the caveat that I have used opensuse since SUSE Linux 9, it is pretty easy to install PosgreSQL.

You can also just install postgresql or postgresql14 or postgresql15 using Yast2's software manager (just search for postgresql and check the box--seriously, that is all you need to do to get started) or Zypper: (as root) zypper in postgresql (or the specific version). You can get the latest by adding the database repository (from download.opensuse.org under http://download.opensuse.org/repositories/server:/database/SLE_15_SP4/).

The install scripts creates the user/group, gives you a reasonable configuration, and creates a service you can start on boot or by hand using the Yast2 (gui) service module or systemctl.

You should then configure authentication/security and add users specific for your need.

Don't make it hard.

DrKC
  • 9
  • 2
  • "*You should then configure authentication/security and add users specific for your need.*" How to do this is what OP is asking about, not how to install Postgres. See above: "**My question: how can I add the new postgres- system operation user account (with right permissions for postgreSQL)?**" This does not appear to answer that question. – TylerH Aug 08 '23 at 21:21
-1

The following information might be useful for anyone else, the postgres- operation system user account is:

  • in a group "postgres"
  • the group has only one member, the user "postgres"
  • the id is always "26"
  • the home directory point to the path to the directory of "pgsql", e.g. /var/lib/pgsql/version/data
  • is a system user/ belongs to the group of system user
  • login disabled
TylerH
  • 20,799
  • 66
  • 75
  • 101
jui
  • 19
  • 4