skip to Main Content

I’m a newbie at suse, maybe some can help?

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)

Thanks for any advice :-)!

2

Answers


  1. Chosen as BEST ANSWER

    @olh, thanks for help, it worked! My problem is solved.

    I think I got lost while comparing to other postgreSQL installation and further documentation: "Pre-packaged versions of PostgreSQL will typically create a suitable user account automatically during package installation." - for manual installation I've spent a bunch of time getting facts about the postres operation system (OS) user account

    Maybe the following information are 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

    (Documentation of pg is in most parts perfect, but these informations seems to be missing!)


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search