Re: in linux, what user do i install postgres under?

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Cc: FredP(at)abag(dot)ca(dot)gov
Subject: Re: in linux, what user do i install postgres under?
Date: 2010-11-20 05:30:20
Message-ID: 4CE75CEC.90905@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Am 15.11.2010 22:45, schrieb Fred Parkinson:
> I want to install postgresql on my local machine (suse linux) as part
> of a development environment.

Yast does this pretty nicely.
This way you'd get the postgres packages and possible patches from your
Linux provider.
If you just want a running server to play with, this is the easiest way.

If you'd rather know how to install non-suse stuff or even compile PG
yourselve then check the other responses here in the list.

There are just two things to mind about getting it from suse.
1) Yast might not show Postgresql 9.0.x at first depending on your
revision of suse, though the current suse should have it right away.
In any other case, you could fetch it from their web site with the
1-click-installer in the web interface for their package search.
Or you could add the right repository to your yast.

2) There are 2 "philosophies" about the install location of the files.
The postgresql-project puts everything below /usr/local/..../psql.

While SUSE sorts the stuff into folders directly below /usr
e.g. programs will be in /usr/bin documentation /usr/share/...
data is in /var/lib/psql
At least thats what I remember.
When I asked a suse dude explained there were some rules that /usr/local
were just for stuff the local admin compiles.

Anyway ... the stuff works regardless where they put it :)
The programs like psql are in the search path so it doesn't matter where
it is and the server is accessed via network.
> My question is: what user do I install postgres under? I know
> postgresql creates a postgres user, so I can't create that from the
> beginning and install from that account. So, what is the relation
> between the account I install under, and postgresql? Can I use any
> login, do I need to log in as root, or is there some other
> user/capability I should sign on with to install postgresql under?

You will install as root.
Normally noone else is allowed to write in the directories where
postgresql will be installed.
That is normally just root is allowed to install anything.
OK you can start yast as any user and it will ask you for a password
whenever you try to do something that needs root privileges.
The first user that got created while suse was installed is
automatically in a group that is allowed to obtain root-priv when asked.
The second and further user has to be explicitely put into this group of
sub-admins.

The data directory hierarchy will belong to the "posgres" and he will
run the server.
Actually it should be irrelevant what user owns the server process as
long as it is no privileged user. So it won't run as root.
That's no problem.
You still can run the startup script as root. Internally the script will
switch to postgres for actually starting thepg server daemon.

All this is done by yast for you if you use it to install postgresql.
In this case you should just go in the runlevel manager and tell it to
start postgresql whenever your pc gets booted.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message bakkiya 2010-11-20 14:22:00 Re: Could not open relation with OID (table partitioning issue?)
Previous Message mark 2010-11-20 03:45:05 Re: Could not open relation with OID (table partitioning issue?)