Setting up PostgreSQL on Ubuntu 18.04

I’m creating a simple table to hold some data that will later be used in a WebApp. I installed postgresql (v10.3) and PGAdmin3.

I mostly followed the guide given on this page. I then switch user to postgres using:

sudo -i -u postgres

Using \password, I switched the password on my local machine to be ‘postgres’.

I created a very simple table

"1";"Thailand";1000;"";""
"2";"Singapore";1;"";""
"3";"Ireland";3;"";""

I added some ‘createdAt’ and ‘updatedAt’ columns and populated them with today’s date using:

UPDATE public.currency
SET createdat = current_date
WHERE currency_id < 10;

Leave a Reply