Class03 Answer

Use apt to install Postgres on Ubuntu 16.04

I did this lab in the ann account of my Ubuntu 16.04 host and it was easy.

(Remember that class01 had a lab to install Ubuntu 16.04 on your laptop).

sudo apt update
sudo apt install  postgresql postgresql-server-dev-all libpq-dev
sudo su - postgres

The psql shell command above, gave me a psql prompt.

I typed these Postgres commands at the psql prompt:

create role ann with login superuser password 'ann';
create database ann;

Next, I remembered to exit from the postgres linux account by typing the shell command: exit

Then, I wrote a shell script to 'wrap' the psql command for the ann account:

# This script should 'wrap' the psql command
/usr/bin/psql -aP pager=no $@

I placed the above script in ~ann/bin/psql.bash

Class03 Lab About Blog Contact Class01 Class02 Class03 Class04 Class05 Class06 Class07 Class08 Class09 Class10 dan101 Forum Google Hangout Vboxen