I have installed postgresql 9.4 on Redhat 7 server.It was installed through postgresql-9.4.3-1-linux-x64.run. It displayed a clear message"postgres is installed your machine". Now when I login as
su - postgres
It doesn't ask for password and goes to bash prompt. If I type psql
displays "command not found". When I tried starting service through root user
service postgresql initdb
I get:
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
I tried start postgres restart
which didn't work. I tried searching and found nothing. I know its with starting service.
service postgresql initdb
initdb is an independent command to create a new database cluster.
You must use it independent, but not as argument for
service
command. Read documentation how to use this command: initdbUse
service postgresql start
to start postgresql service andservice postgresql stop
to stop it.psql: "command not found"
Try to switch into
postgres
user usingsu postgres
command (without dash). It effects on$PATH
environment variable.If this wouldn't help use full path to specify the command, for example/usr/bin/psql