Not able to install postgres


1 Answer(s)


hi Sankara,

Not sure what *nix version are you using but from the post sounds like you are trying to install Postgres on SuSE

Here is the easy way:
Login to Suse and open Yast or Yast2 manager. From the yast tool search for "Postgresql" and select Select or Install.

Once postgresql is installed start it using:
service postgresql start

then login to Postgresql shell using: psql

or you can use Zypper to install the postgresql software:

su - root

zypper install postgresql postgresql-contrib postgresql-devel postgresql-docs postgresql-plperl postgresql-plpython postgresql-pltcl postgresql-server

configuring postgresql:
-------------
systemctl restart postgresql.service
vi /var/lib/pgsql/data/postgresql.conf

Go to Connections and Communications section, find the “listen_address” variable. Uncomment the “listen_addresses” and place “*” instead of “localhost”

listen_addresses = "*"

Add your network to access database remotely; Edit /var/lib/pgsql/data/pg_hba.conf

vi /var/lib/pgsql/data/pg_hba.conf

Add the following line according to your network configuration with md5 password authentication (Enable remote access of database).

# Local networks
host all all xx.xx.xx.xx/xx md5
# Example
host all all 192.168.0.0/24 md5
host all all 127.0.0.1/32 md5

Restart postgresql server:
systemctl restart postgresql.service

Confirm the PostgreSQL listening.
netstat -ant | grep 5432

Create Database:
su -l postgres
createdb test
psql test
CREATE USER pguser WITH SUPERUSER LOGIN PASSWORD 'pgpassword';
psql -h -d test -U pguser

You can also install PgAdmin UI to work with Postgresql:
zypper install pgadmin3
pgadmin3

hope this helps

Thanks