last tested on Xenial Xerus(16.04)
First add the postgresql repo to PC's sources list...
echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' | sudo tee -a /etc/apt/sources.list.d/test.list > /dev/null
then ...
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
then ...
sudo apt update
then ....
sudo apt install postgresql-10
sudo nano /etc/postgresql/10/main/pg_hba.conf
or ...
sudo vi /etc/postgresql/10/main/pg_hba.conf
... if you don't have nano
installed and you're a god.
You can change peer
to trust
or md5
, then restart server
sudo service postgresql restart
psql -U postgres
createdb -U postgres database_name
psql -U postgres database_name
or if already in the psql
shell,
\c database_name
updated frequently (i.e. as I run into more)
\l
=> list available databases in current Postgres server\dt
=> list all tables in current db\q
=> exit psql\d table_name
=> shows details/schema of passedtable_name