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

in linux, what user do i install postgres under?

From
"Fred Parkinson"
Date:
I am a windows user that is trying to switch to linux.
 
I want to install postgresql on my local machine (suse linux) as part of a development environment.
 
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?
 
Thanks in advance for any help.
 
 
Fred Parkinson
Application Programmer
Association of Bay Area Governments
510-464-7931

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

From
Matthew Walden
Date:
The graphical installer is probably your best bet -

http://www.enterprisedb.com/products/pgdownload.do

See the associated Installation Guide on that page too.  It will guide you through the process but you need to install as root or a user with access to sudo.

On Mon, Nov 15, 2010 at 9:45 PM, Fred Parkinson <FredP@abag.ca.gov> wrote:
I am a windows user that is trying to switch to linux.
 
I want to install postgresql on my local machine (suse linux) as part of a development environment.
 
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?
 
Thanks in advance for any help.
 
 
Fred Parkinson
Application Programmer
Association of Bay Area Governments
510-464-7931



--
Oracle / PostgreSQL DBA - UK

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

From
Leif Biberg Kristensen
Date:
On Monday 15. November 2010 22.45.47 Fred Parkinson wrote:
> I am a windows user that is trying to switch to linux.

Congratulations :D

> I want to install postgresql on my local machine (suse linux) as part
of a development environment.
>
> 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?

In Linux and other *nixes, you almost invariably install programs as
root. You must also run the initdb part as root to set up the database
cluster, and start the postgresql service. Then you switch to the
postgres user to run the command createuser, in order to be able log in
to a database as your ordinary user account.

regards,
Leif B. Kristensen
Gentoo Linux user since 2003

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

From
Andreas
Date:
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.