I setup a Ubuntu Linux server on an Azure VM and installed PostgreSQL 12. To access the server, I am using Putty to SSH in and execute commands. However, I keep encountering the error command not found
for various commands. In an attempt to get this to work, I use sudo
in front of the command, but that is when it prompts me for the password of postgres. Reading online it looks like this is a password that should not be unlocked. I believe my issue is related to permissions of my admindj user that I setup, but with both Linux and PostgreSQL being brand new to me I am slightly struggling to wrap my head around how would I grant this access if that even is the true issue.
CodePudding user response:
you can try to find the location of pg_controldata by :
find /usr/lib -name pg_controldata
It can give something like
/usr/lib/postgres/12/bin/pg_controldata
Then you can put in your $HOME/.bashrc :
PATH=$PATH:/usr/lib/postgres/12/bin
And restart a new bash session, you will have access to pg_controldata
You may need to add in your $HOME/.bash_profile
source $HOME/.bashrc