How to import data from a CSV file into a PostgreSQL database
I was working on my personal project last week and needed to import some data in CSV format to a PostgreSQL database. I wanted only certain fields to be imported so I had to specify this in the command. I’m new to PostgreSQL so it took me quite a bit of Googling to figure out exactly how to do this.
Here’s how I did it on Ubuntu 10.04 LTS, ‘glucosetracker’ is the name of my …