How to restart Postgres database?

Hello,

I'm newbie to Postgres. Software version is:
- PostgreSQL 7.4.2
- Conectiva Linux 10

 I'm trying to connect pgAdmin to database server, but I can't. I got error:
"FATAL: NO PG_HBA.CONf entry for host"

I found that solution is searching for the file pg_hba.conf and then add the following line:

host all all 192.168.10.1 255.255.255.0 password

Restart the PostgreSQL database. After that, connect to PostgreSQL database server through pgAdmin.

Problem is that I don't know how to restart database.

I tried:

# /etc/rc.d/init.d/postgresql stop
or
# /etc/rc.d/init.d/postgresql restart

But got the following error:

-bash: postgresql: command not found

How do I restart database?
LVL 1
miyahiraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Galtar99Commented:
Try executing as root:

/sbin/service postgresql restart
0
jodix2002Commented:
I don't use connectiva, I use debian. But i think it is about the same.

In my box, I use postgres-8.3. So to restart my postgresql, this is the command:

/etc/init.d/postgresql-8.3 restart

In your case, you need to go to init.d and do 'ls' to see what exactly the filename of the script is...
0
JulianvaCommented:
try this to restart

from linux command line - service servicename restart - make sure the service name is correct. you can type service then pos - press tab key the full service name should display then type restart.

you then need to vim the pg_hba.conf file - if only you are connecting to the database then use the postgres account you created during the installation you will be able to create other users in the database  or add the users to the hba file like this
type      database    user    ip-address                                                         method  
host      all                all        the machine you connecting from                      md5

the user that you add in th hba file is the user that you added to the database after connecting with the postgres account.

all means that all the databases and all the users can connect from this ip-address.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vijaytrendzCommented:
Hey buddy, It looks like you are using pretty old PostgreSQL. PostgreSQL has developed in years and it's growing the current 8.5 i think. Okay looking at your solution. The service command "service postgresql-* restart" won't help you at all. Try this i'm sure you can restart your postgres,

Log into your server in which database runs,

login : root
password : <root's password>

su - postgres

pg_ctl -D <database_directory> restart

ex: /opt/pgsql/bin/pg_ctl -D /opt/pgsql/data restart

Please, specify the proper postgresql database location in which it has installed.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PostgreSQL

From novice to tech pro — start learning today.