PSQL database Argo data

Introduction

There are a couple of steps to putting all the Argo data required into the PSQl database:

  1. create the database: use the createdb command and create the tables and columns
  2. add data to the database: looping through each robotic device for each year to add data to the database

The datbase seems to be stored on /dev/mapper/VolGroup00-LogVol00, which has 95Gb available. I have managed to fill this disk.

Create the database

The current database is called insert_argo and is created from the computer lovejoy with:

createdb insert_argo 
(and can be destoyed with dropdb insert_argo).

The entries for the table are created by running the create_init_base.scr script in /users/resc/postgres/Argo_QC_work/bin. Three tables have been created for the database:

  1. summary of each robotic probe for each year
  2. the profile data
  3. all the data, so includes the data at every level. This is obviously fairly bulky and can take minutes to sift through.

Adding data to the database

Before discussing how all the data is added to the database, it's helpful to explain how the SQL files are created for one robotic device for one year. There is a C++ program insert2psql.cpp, found in /users/resc/postgres/Argo_QC_work/code, that reads in data from a combined data file and creates an SQL file for each of the required tables. These files can be used to enter data to the database with the command

psql -f ⟨SQL file⟩ -d insert_argo
where ⟨SQL file⟩ is one of any of the three SQL files created with executable from insert2psql.cpp.

Now that there is a method to add the data for one robotic device for one year, the scripts insert_argo.scr, found in /users/resc/postgres/Argo_QC_work/bin, is used to loop across all the avialable robotic devices for all the years.

Other useful stuff

Other useful commands are:

  • psql -l: lists all the database available

The data seems to be stored in /usr/local/pgsql/data.

Things to do now

Contact

Page navigation