Copy and paste each block of code to your colab notebook and run them all so you can save data in your postgres database and query (retierive) data from it.
Setup
%%bash
# Install postgresql server
sudo apt-get -y -qq update
sudo apt-get -y -qq install postgresql