-> After the installation of postgresql we need to create the user account for the postgresql.
-> For this login as root and then execute the cmd below.
cmd:adduser postgres
-> Now the user is added and now the prompt is at created user.
To add the created user to sudo userslist:
-> We can not directly execute the sudo by simply creating the user an error will be come like this.
-> Then execute the cmd below in the root login.
cmd: sudo usermod -aG sudo,adm postgres_user
-> Now the user is added to the sudo users list.
To give privilliges to the particular folder:
cmd:mkdir /DB/test/
-> While creating the directory if the error comes as below
-> Then give the privilliges to the particular folder using the cmd
cmd:sudo chown postgres_user:postgres_user /DB/
-> Now we can able to create the folder.
cmd:mkdir /DB/test/
To change the password of the user:
-> Login as the user for which the password needs to be changed.
-> Then use the cmd and give the old password and then new password.
cmd: passwd postgres_user
-> Now we can see the password is changes successfully.
To remove the user
cmd:deluser postgres2