Install postgresql
$ sudo apt install postgresql
Purge (clean uninstall) postgresql
$ sudo service postgresql stop
$ sudo apt --purge remove postgresql\*
$ sudo rm -rf /var/lib/postgresql/
$ sudo userdel -r postgres
Install pgadmin
$ docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=user@domain.com" -e "PGADMIN_DEFAULT_PASSWORD=SuperSecret" -d dpage/pgadmin4
Access postgresql
$ sudo -u postgres psql postgres
See list of user
postgres=# \du
See list of database
postgres=# \l
Connect database
postgres=# \c postgres
Create user
$ sudo -u postgres createuser lite
Quit postgresql
postgres=# \q
$ sudo apt install postgresql
Purge (clean uninstall) postgresql
$ sudo service postgresql stop
$ sudo apt --purge remove postgresql\*
$ sudo rm -rf /var/lib/postgresql/
$ sudo userdel -r postgres
Install pgadmin
$ docker run -p 80:80 -e "PGADMIN_DEFAULT_EMAIL=user@domain.com" -e "PGADMIN_DEFAULT_PASSWORD=SuperSecret" -d dpage/pgadmin4
Access postgresql
$ sudo -u postgres psql postgres
See list of user
postgres=# \du
See list of database
postgres=# \l
Connect database
postgres=# \c postgres
Create user
$ sudo -u postgres createuser lite
Quit postgresql
postgres=# \q
Komentar
Posting Komentar