Re: postgresql


Subject: Re: postgresql
From: Kevin Liang (kevin@vcn.bc.ca)
Date: Thu Feb 10 2000 - 22:11:58 MST


Sorry, the message was on that 'other' linux distro for macs' mailing
list. So I'll just post what was said..

* Kevin C S Liang (7kcsl@qlink.queensu.ca) [000123 21:51]:
>
> Hi,
> I just spent some time printing out the manual for postgresql, and
> would like to try it for some future work, but I don't even know how to
> get it properly started. Do I need to create a superuser first ? This
> error msg keeps popping up at the psql/createuser command
>
> Connection to database 'template1' failed.
> connectDB() -- connect() failed: Connection refused
> Is the postmaster running at 'localhost' and accepting connections on
Unix
> socket '5432'?
>

First su to user postgres (su - postgres). You'll be in /var/lib/pgsql.
Edit .bash_profile and add:

PGDATA=/usr/lib/pgsql
PGLIB=/usr/lib/pogsql
export PGDATA PGLIB

Then, still as user postgres, do
$ source .bash_profile
$ initdb

As root:

# /etc/rc.d/init.d/postgresql start

Then you can start as postgres (the PostgreSQL super-user) to admin your
databases, eg.
$ createdb mydb
$ psql mydb

etc ...

<advocacy>
mySQL is most used than PostgreSQL, but the latter is much more
powerful, scalable and fun! :-)
</advocacy>

Cheers,

Simon (spiette@generation.net>

----then there's--

Actually, the user is "postgres", and should be listed in /etc/passwd.
Or, as root, simply 'su postgres' to see if it has been created. The
user named 'postgres' is the postgres superuser. If you installed via
rpm, it should be there.

Franck is correct that you must have the postmaster *process* running.
If you installed via rpm, you can do the following as root to start
postmaster:

/etc/rc.d/init.d/postgres start

Then 'su postgres'. As the postgres user you have to initialize the
database (once only):

initdb

If this gives you errors then you'll have to set up the environment
variables for the postgres user (PGDATA and PGLIB). If you need help
with that, let me know.

If initdb works, then you can just do:

pgsql template1

to connect.

If you want to create another database user account, you should be
able to do so once postmaster is running.

If you want to have postgres running everytime you start up, you need
to modify your startup scripts. I use ntsysv to add/remove services to
start at boot.

Hope that helps,
Geoff
Geoffrey.Kinnel@bms.com

.....whew..hope this is it..

Kevin



This archive was generated by hypermail 2a24 : Wed Mar 01 2000 - 00:07:10 MST