Re: How do I set up the server? - Mailing list pgsql-general

From Richard Huxton
Subject Re: How do I set up the server?
Date
Msg-id 003501c0b2f6$53fc0c60$1001a8c0@archonet.com
Whole thread Raw
List pgsql-general
From: "Ernest Wolfe" <edwolfe@xmission.com>

> ED Wolfe, Technical Writer
> call or fax 801-485-0058
>
> Dear Mr. Huxton,
>
> I found your e-mail while wading through the various explanations of
> psql, none of which come close to telling me precisely what I need to
> know.  I can't get past a basic error message, seemingly no matter

Did you get it from Postgres Notes? If so, that's fine, but I've cc'd this
to the pgsql-general list - there are a lot more people there who can help
you and many of them know lot more than me (including the fella who
maintains the postgres rpm). You'll probably find it worth subscribing to
the mailing list.

> what I try to do.  I installed Postgresql along with Redhat 7 but when
> I attempt to type a command to initiate a test db I get an error
> message.  It asks me whether my domain is localhost and if my port is
> 5436, or something like that number.  And then it kicks me back out.

Well, that kind of makes sense - if you want to attach from another machine,
you connect to port 5436.

> All I want to do is run psql on a standalone for my own stuff.  Since
> Redhat won't let me run dbase (Corel did, only so long as I didn't
> show nerve enough to try to save anything), I figure that psql is the
> logical choice.  I have run similar-looking databases, and can work my
> way through the various commands, but this server-stuff has me
> flummoxed.  Can you tell me how to set things up very basically so
> that I can run psql on a standalone computer installed with Redhat 7?
> Otherwise I am forced to make do with QuickList.

Well - Postgres runs in two parts the client (psql) and the server (called
postmaster). The server runs as user postgres (to su to postgres you might
have to su to root then su to postgres)

First make sure you've run initdb (man initdb) as user postgres if it hasn't
been done already. This will set up your database directories. I'm not sure
where these will be with the RPM - probably under var or opt (and owned by
postgres) - look for a directory "data" with a sub-dir called "base". The
RPM may have done this for you, but if you run initdb again it won't
overwrite things so don't worry.

Next thing is to make sure the postmaster is running:
  ps auxw | grep postmaster
You should have a line owned by postgres and with the postmaster command. If
not, look in /etc/rc.d/init.d and there should be a
postgres/postmaster/pgsql startup script in there. Run it something like:
  /etc/rc.d/init.d/postgres start
Do this as root.

Now as postgres make sure you exist as a user and you have a database:
  createuser ernestw
  createdb ernestw
Read the man pages for these first, and obviously use whatever username is
appropriate.

Now as ernestw try psql and you should have a command-prompt in your own
database. You can use \? and \h to get help \q to quit.

There's a lot of stuff on this in the tutorial part of the manual (see
www.postgresql.org) and in the administrator's guide.

It's also worth looking at the online version of Bruce Momijan's book
(there's a link on the website) and even buying the paper copy (always nice
to have a reference next to you).

HTH

- Richard Huxton



pgsql-general by date:

Previous
From: "Richard Huxton"
Date:
Subject: Re: Foreign keys/unique values and views
Next
From: will trillich
Date:
Subject: Re: Hope it is not too offtopic