postgre

enter postgre shell

psql

check is truly initialized

pg_isready

check systemd service

sudo systemctl status postgresql

change UNIX user postgres password

sudo passwd postgres

Creating user

 sudo -u postgres createuser <username>

Creating Database

sudo -u postgres createdb <dbname>

Giving the user a password

psql

\password <username>;

Granting privileges on database

psql 

grant all privileges on database <dbname> to <username> ;

Grant superuser

ALTER USER myuser WITH SUPERUSER;

Remove superuser status:

ALTER USER username WITH NOSUPERUSER;

check user

psql

\du

You'll only receive email when they publish something new.

More from Rifky Adni Putra
All posts