Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Installed postgresql through RH 7.2

Installed postgresql through RH 7.2

Installed postgresql through RH 7.2

I selected all the postgresql packages  before RH7.2 installation started. RH7.2 installation completed without any problems. So I proceeded to check if postgresql is installed.

#su - postgres
$ postgres

Then it said that it could not find

Did I miss out on some packages or skipped some steps?

Please help.

RE: Installed postgresql through RH 7.2

postgres used to install into /var/lib but these days it usually ends up in /usr/local/pgsql. You need to find out where the postgresql binaries are located. This can be done by using rpm to interrogate the package as follows

rpm -ql postgres | grep pg_ctrl

If this fails then use

find / -name pg_ctrl 2>/dev/null

RE: Installed postgresql through RH 7.2

I thought this command
#su - postgres
$ postgres
would get it working.

In fact, I used the same 2 discs to install the same RH7.2 with postgresql on another machine, everything went fine and all the files are in /var/lib.

RE: Installed postgresql through RH 7.2

I found the pg_ctl. Its located in /usr/bin.
When I typed
# ./pg_ctl start
I get the following messages.

"pg_ctl: no database directory or environment variable $PGDATA is specified"

Is there something I missed out here also?

RE: Installed postgresql through RH 7.2

Hi taneujin,

From the root command line type "setup" and a menu will appear on your screen.  Then select "services" and a list of available servers will appear in a scoll list.  Scroll down the list until you come to postgres and make sure it is selected.  Then reboot your system and postgres should automatically be started as a process of starting your system.

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox

RE: Installed postgresql through RH 7.2

I have no idea about postgres...sorry.

Can you tell me how I can check if postgresql is really running/functional?

I have done the above step (setup) and made sure it was checked (it wasn't checked).

I do not know what I should do next to see if its really running well.

RE: Installed postgresql through RH 7.2

To check whether postgreSQL is running you use the following command...

ps -ef | grep post

If postgreSQL is running you should see a postmaster task in the output. You could also try running psql - if postgreSQL is running you should get an error back saying that a database named as your userid is not present.

The way postgreSQL starts is via a script called postgresql located in the /etc/rc.d/init.d directory. You run

/etc/rc.d/init/d/postgresql start to start the system and /etc/rc.d/init/d/postgresql stop to stop it.

Normally there are soft links to this script in the /etc/rc3.d and other directories, these are named S##postgres, where ## is a number, to start the system at that run-level and K##postgres to stop it at that run-level.

Presumably the rpm install process has done the initdb required to set up the database templates etc. (I normally compile & install from sources)

Cheers - Gavin

RE: Installed postgresql through RH 7.2

I have checked and I think its working.

But, may I know why it prompted me
/var/lib/data/pg_ctrl is not found (1st post)

when I first typed postgres as postgres user?

RE: Installed postgresql through RH 7.2

It would appear that the script postgres is incorrect and needs to be corrected. Find out postgres's seatch path by typing

echo $PATH

then look for a script called postgres in each of the directories listed, when you find it you need to edit it to correct the path error.

Also run env | grep \/var\/lib\/data to see if the path is contained in an environment variable.

RE: Installed postgresql through RH 7.2

I have tried to startup postgres from the setup menu and it worked.

When I went back to the data directory (after postgres has started) there were quite a number of files.

But when I do not startup postgres, there are no files there.

May I know why?

As for the path, its correct.
Its in /var/lib/data.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close