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
servicecommand. Read documentation how to use this command: initdbUse
service postgresql startto start postgresql service andservice postgresql stopto stop it.psql: "command not found"
Try to switch into
postgresuser usingsu postgrescommand (without dash). It effects on$PATHenvironment variable.If this wouldn't help use full path to specify the command, for example/usr/bin/psql