Skip to content

Importing Data to PostgreSQL

Yiping Su edited this page Apr 13, 2020 · 1 revision

Overview

Isabelle's Search command relies on a pre-existing PostgreSQL database on the same server. I have already provided the data file that is located in the main repository.

Image from Gyazo

The data is located in data.csv, and the PostgreSQL import code is located in setBugFish.psql.

Configuring setBugFish.psql

The SQL code requires an absolute path to your data file in order to import the code. You can find your path by using pwd.

Image from Gyazo

After you get your path, make sure to append data.csv to the end. In my case, the path that I will insert into setBugFish.psql is: /home/yiping/go/src/github.com/yiping-allison/isabelle/data.csv.

Importing Data to PostgreSQL

After you set your path, you can import the CSV file into Postgre using:

psql -U [username] -d [database] < setBugFish.psql


If you followed all the steps correctly so far, you should see a message that a table with 160 values has been created. At this point, you are done with the hard setup!