[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-user
Subject:    [gentoo-user] postgresql 7.1 post-install
From:       Collins Richey <erichey2 () home ! com>
Date:       2001-11-24 18:06:28
[Download RAW message or body]


After you have emerged postgresql 7.1, here's what you need to do to
run postgresql as a normal user.

1) You need a user postgres.  Postgresql will not start or run from
root.  On my fairly early _rc6 system, the userid for postgres was
broken (no shadow entry), so I had to delete and add again.

	* su
	* Be sure you have a group.  in /etc/group my entry is
		postgres::70:postmaster
	* userdel postgres (will complain about shadow entry)
	* useradd -u 70 -d /home/postgres -m -g postgres -s /bin/bash
postgres
	* passwd postgres (pick a password)

2) Now you need to initialize a database cluster

	* still su to root
	* mkdir /usr/local/pgsql (or pick another location)
	* chown postgres.postgres /usr/local/pgsql
	* exit
	* su - postgres
	* initdb -D /usr/local/pgsql (or your location)
	* exit

3) Now you need to setup the server daemon bootup files and start the
server.  Note from the script, the startup for postmaster most be done
su to postgres (will not run as root).  My script is a very basic one;
other distros have extensive logic to verify that the postgresql
software is at the correct level, the initdb has been done, etc.

	* su
	* copy the attached script to /etc/init.d/postgres
	* chmod 755 /etc/init.d/postgres
	* edit /etc/init.d/postgres and verify PGxxxxx variables
	* cd /etc/runlevels/default
	* ln -s ../init.d/postgres postgres
	* ./postgres start
	* ps ax | grep postmaster and verify that postmaster is running
	* exit

4) Postgresql does not use normal unix userid.  You must add a user or
users via postgresql commands

	* su - postgres
	* createuser userid
		Reply to prompt "allow to create a databse"
	* exit

5) Now you are ready to checkout the tutorial, create a database, etc.
 You can use the interactive psql program to run the tutorial.  The
documentation was installed by emerge at the following location. 
Point your browser here.  A link for the tutorial is at the top of the
table of contents.  the psql program is documented under Postgresql
Client Applications.

	file:///usr/share/doc/postgresql-7.1/html/index.html

enjoy
-- 
Collins Richey
Denver Area
gentoo_rc6 k2.4.15-pre5+ext3+xfce+sylpheed+galeon

["postgres" (application/octet-stream)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic