Class03 Answer

Use apt-get 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-get install  postgresql postgresql-server-dev-all libpq-dev
sudo su - postgres
/usr/bin/psql

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;
\q

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:


#!/bin/bash
# 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


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