<<O>>  Difference Topic XeniaTableSchema (r1.18 - 16 Feb 2007 - JeremyCothran)

Xenia Table Schema

Line: 122 to 122

The multi_obs specifies m_date as being 'timestamp without time zone'. All m_date values should be GMT.

Added:
>
>
I'm leaving m_date, m_lat, m_lon, m_z, m_value without a 'not null' constraint for now. In the XeniaPackageV2 there is a 'collection' table which support a collection or grouping of measurements which may cover a range of time or position but not have a specific value. Also relating to version 2 are vector types which may be ambiguous in the specific layout of how measurements are recorded.

The following two items are optional add-ons to the existing simple schema

  • The multi_obs table is the only PostGIS? enabled table. There is a trigger which auto-updates the_geom field for an inserted long and lat.
Line: 196 to 198

META FILEATTACHMENT obs_data_dictionary.sql attr="" comment="NA" date="1163623762" path="obs_data_dictionary.sql" size="7165" user="JeremyCothran" version="1.3"
META FILEATTACHMENT db_multi_obs_beta_support1.sql attr="" comment="NA" date="1149021440" path="db_multi_obs_beta_support1.sql" size="2192" user="JeremyCothran" version="1.1"
META FILEATTACHMENT db_xenia_v1_simple_schema.sql attr="" comment="NA" date="1163969667" path="db_xenia_v1_simple_schema.sql" size="11038" user="JeremyCothran" version="1.5"
Changed:
<
<
META FILEATTACHMENT db_xenia_v1_extra_schema.sql attr="" comment="NA" date="1171384336" path="db_xenia_v1_extra_schema.sql" size="9989" user="JeremyCothran" version="1.2"
>
>
META FILEATTACHMENT db_xenia_v1_extra_schema.sql attr="" comment="NA" date="1171642969" path="db_xenia_v1_extra_schema.sql" size="9929" user="JeremyCothran" version="1.3"

META FILEATTACHMENT insert_organization.sql attr="" comment="NA" date="1161899263" path="C:\Documents and Settings\logan\Desktop\insert_organization.sql" size="1497" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_platform_type.sql attr="" comment="NA" date="1161899282" path="C:\Documents and Settings\logan\Desktop\insert_platform_type.sql" size="846" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_platform.sql attr="" comment="NA" date="1161899301" path="C:\Documents and Settings\logan\Desktop\insert_platform.sql" size="23377" user="JeremyCothran" version="1.1"
 <<O>>  Difference Topic XeniaTableSchema (r1.17 - 13 Feb 2007 - JeremyCothran)

Xenia Table Schema

Line: 196 to 196

META FILEATTACHMENT obs_data_dictionary.sql attr="" comment="NA" date="1163623762" path="obs_data_dictionary.sql" size="7165" user="JeremyCothran" version="1.3"
META FILEATTACHMENT db_multi_obs_beta_support1.sql attr="" comment="NA" date="1149021440" path="db_multi_obs_beta_support1.sql" size="2192" user="JeremyCothran" version="1.1"
META FILEATTACHMENT db_xenia_v1_simple_schema.sql attr="" comment="NA" date="1163969667" path="db_xenia_v1_simple_schema.sql" size="11038" user="JeremyCothran" version="1.5"
Changed:
<
<
META FILEATTACHMENT db_xenia_v1_extra_schema.sql attr="" comment="NA" date="1161899237" path="C:\Documents and Settings\logan\Desktop\db_xenia_v1_extra_schema.sql" size="8519" user="JeremyCothran" version="1.1"
>
>
META FILEATTACHMENT db_xenia_v1_extra_schema.sql attr="" comment="NA" date="1171384336" path="db_xenia_v1_extra_schema.sql" size="9989" user="JeremyCothran" version="1.2"

META FILEATTACHMENT insert_organization.sql attr="" comment="NA" date="1161899263" path="C:\Documents and Settings\logan\Desktop\insert_organization.sql" size="1497" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_platform_type.sql attr="" comment="NA" date="1161899282" path="C:\Documents and Settings\logan\Desktop\insert_platform_type.sql" size="846" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_platform.sql attr="" comment="NA" date="1161899301" path="C:\Documents and Settings\logan\Desktop\insert_platform.sql" size="23377" user="JeremyCothran" version="1.1"
 <<O>>  Difference Topic XeniaTableSchema (r1.16 - 30 Jan 2007 - JeremyCothran)

Xenia Table Schema

Line: 120 to 120

On the multi_obs table the field platform_handle is the same format as station_id referenced in earlier schemas - a concatenation of organization(short_name)_platform(short_name)_platform_type(type_name) like carocoops_CAP2_buoy

Changed:
<
<
The multi_obs table is the only PostGIS? enabled table. There is a trigger which auto-updates the_geom field for an inserted long and lat.
>
>
The multi_obs specifies m_date as being 'timestamp without time zone'. All m_date values should be GMT.

Changed:
<
<
The multi-obs table also includes an auto-update trigger to set the qc test table ignore flag to false so the qc test will be re-run on the next qc processing.
>
>
The following two items are optional add-ons to the existing simple schema

  • The multi_obs table is the only PostGIS? enabled table. There is a trigger which auto-updates the_geom field for an inserted long and lat.

  • The multi-obs table also includes an auto-update trigger to set the qc test table ignore flag to false so the qc test will be re-run on the next qc processing.

Observations Data Dictionary

 <<O>>  Difference Topic XeniaTableSchema (r1.15 - 20 Nov 2006 - JeremyCothran)

Xenia Table Schema

Line: 42 to 42

A sample observation data dictionary population SQL is available here. This contains most of the currently collected observation types for the existing Seacoos database.

Changed:
<
<
A support table population(m_type_display_order) for controlling the display order of measurement table is available here.
>
>
A support table population(m_type_display_order) for controlling the display order of measurement table is available here.

To install this table(assuming Postgres already installed) run

Line: 199 to 199

META FILEATTACHMENT insert_sensor_type.sql attr="" comment="NA" date="1161899319" path="C:\Documents and Settings\logan\Desktop\insert_sensor_type.sql" size="2402" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_sensor.sql attr="" comment="NA" date="1161899337" path="C:\Documents and Settings\logan\Desktop\insert_sensor.sql" size="136052" user="JeremyCothran" version="1.1"
META FILEATTACHMENT m_type_display_order.sql attr="" comment="NA" date="1163969686" path="m_type_display_order.sql" size="1869" user="JeremyCothran" version="1.1"
Added:
>
>
META FILEATTACHMENT display_order.txt attr="" comment="NA" date="1164052977" path="display_order.txt" size="2083" user="JeremyCothran" version="1.1"
 <<O>>  Difference Topic XeniaTableSchema (r1.14 - 19 Nov 2006 - JeremyCothran)

Xenia Table Schema

Line: 42 to 42

A sample observation data dictionary population SQL is available here. This contains most of the currently collected observation types for the existing Seacoos database.

Added:
>
>
A support table population(m_type_display_order) for controlling the display order of measurement table is available here.

To install this table(assuming Postgres already installed) run


Line: 166 to 168

November 19, 2025

  • added a url field to the sensor table (each sensor could potentially link to it's own display page)
Added:
>
>
  • added a support table(m_type_display_order) and population for ordering the measurement listings in various displays

Conventions

Line: 188 to 191

META FILEATTACHMENT obs_data_dictionary.sql attr="" comment="NA" date="1163623762" path="obs_data_dictionary.sql" size="7165" user="JeremyCothran" version="1.3"
META FILEATTACHMENT db_multi_obs_beta_support1.sql attr="" comment="NA" date="1149021440" path="db_multi_obs_beta_support1.sql" size="2192" user="JeremyCothran" version="1.1"
Changed:
<
<
META FILEATTACHMENT db_xenia_v1_simple_schema.sql attr="" comment="NA" date="1163963017" path="db_xenia_v1_simple_schema.sql" size="10590" user="JeremyCothran" version="1.4"
>
>
META FILEATTACHMENT db_xenia_v1_simple_schema.sql attr="" comment="NA" date="1163969667" path="db_xenia_v1_simple_schema.sql" size="11038" user="JeremyCothran" version="1.5"

META FILEATTACHMENT db_xenia_v1_extra_schema.sql attr="" comment="NA" date="1161899237" path="C:\Documents and Settings\logan\Desktop\db_xenia_v1_extra_schema.sql" size="8519" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_organization.sql attr="" comment="NA" date="1161899263" path="C:\Documents and Settings\logan\Desktop\insert_organization.sql" size="1497" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_platform_type.sql attr="" comment="NA" date="1161899282" path="C:\Documents and Settings\logan\Desktop\insert_platform_type.sql" size="846" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_platform.sql attr="" comment="NA" date="1161899301" path="C:\Documents and Settings\logan\Desktop\insert_platform.sql" size="23377" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_sensor_type.sql attr="" comment="NA" date="1161899319" path="C:\Documents and Settings\logan\Desktop\insert_sensor_type.sql" size="2402" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_sensor.sql attr="" comment="NA" date="1161899337" path="C:\Documents and Settings\logan\Desktop\insert_sensor.sql" size="136052" user="JeremyCothran" version="1.1"
Added:
>
>
META FILEATTACHMENT m_type_display_order.sql attr="" comment="NA" date="1163969686" path="m_type_display_order.sql" size="1869" user="JeremyCothran" version="1.1"
 <<O>>  Difference Topic XeniaTableSchema (r1.13 - 19 Nov 2006 - JeremyCothran)

Xenia Table Schema

Line: 157 to 157

Schema changes

Changed:
<
<
October 28, 2025 added to table organization columns url and opendap_url
>
>
October 28, 2025
  • added to table organization columns url and opendap_url

November 15, 2025
  • made all varchar fields a minimum of 50 characters
  • added several new uom_types, obs_types, m_types and corrected a few (see new obs_data_dictionary file)
Added:
>
>
November 19, 2025
  • added a url field to the sensor table (each sensor could potentially link to it's own display page)

Conventions

column names

Line: 183 to 188

META FILEATTACHMENT obs_data_dictionary.sql attr="" comment="NA" date="1163623762" path="obs_data_dictionary.sql" size="7165" user="JeremyCothran" version="1.3"
META FILEATTACHMENT db_multi_obs_beta_support1.sql attr="" comment="NA" date="1149021440" path="db_multi_obs_beta_support1.sql" size="2192" user="JeremyCothran" version="1.1"
Changed:
<
<
META FILEATTACHMENT db_xenia_v1_simple_schema.sql attr="" comment="NA" date="1163623787" path="db_xenia_v1_simple_schema.sql" size="10558" user="JeremyCothran" version="1.3"
>
>
META FILEATTACHMENT db_xenia_v1_simple_schema.sql attr="" comment="NA" date="1163963017" path="db_xenia_v1_simple_schema.sql" size="10590" user="JeremyCothran" version="1.4"

META FILEATTACHMENT db_xenia_v1_extra_schema.sql attr="" comment="NA" date="1161899237" path="C:\Documents and Settings\logan\Desktop\db_xenia_v1_extra_schema.sql" size="8519" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_organization.sql attr="" comment="NA" date="1161899263" path="C:\Documents and Settings\logan\Desktop\insert_organization.sql" size="1497" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_platform_type.sql attr="" comment="NA" date="1161899282" path="C:\Documents and Settings\logan\Desktop\insert_platform_type.sql" size="846" user="JeremyCothran" version="1.1"
 <<O>>  Difference Topic XeniaTableSchema (r1.12 - 15 Nov 2006 - JeremyCothran)

Xenia Table Schema

Line: 158 to 158

Schema changes

October 28, 2025 added to table organization columns url and opendap_url

Added:
>
>
November 15, 2025
  • made all varchar fields a minimum of 50 characters
  • added several new uom_types, obs_types, m_types and corrected a few (see new obs_data_dictionary file)

Conventions

Line: 178 to 181

-- JeremyCothran - 26 May 2025

Changed:
<
<
META FILEATTACHMENT obs_data_dictionary.sql attr="" comment="NA" date="1161895553" path="obs_data_dictionary.sql" size="4893" user="JeremyCothran" version="1.2"
>
>
META FILEATTACHMENT obs_data_dictionary.sql attr="" comment="NA" date="1163623762" path="obs_data_dictionary.sql" size="7165" user="JeremyCothran" version="1.3"

META FILEATTACHMENT db_multi_obs_beta_support1.sql attr="" comment="NA" date="1149021440" path="db_multi_obs_beta_support1.sql" size="2192" user="JeremyCothran" version="1.1"
Changed:
<
<
META FILEATTACHMENT db_xenia_v1_simple_schema.sql attr="" comment="NA" date="1162037194" path="db_xenia_v1_simple_schema.sql" size="10558" user="JeremyCothran" version="1.2"
>
>
META FILEATTACHMENT db_xenia_v1_simple_schema.sql attr="" comment="NA" date="1163623787" path="db_xenia_v1_simple_schema.sql" size="10558" user="JeremyCothran" version="1.3"

META FILEATTACHMENT db_xenia_v1_extra_schema.sql attr="" comment="NA" date="1161899237" path="C:\Documents and Settings\logan\Desktop\db_xenia_v1_extra_schema.sql" size="8519" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_organization.sql attr="" comment="NA" date="1161899263" path="C:\Documents and Settings\logan\Desktop\insert_organization.sql" size="1497" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_platform_type.sql attr="" comment="NA" date="1161899282" path="C:\Documents and Settings\logan\Desktop\insert_platform_type.sql" size="846" user="JeremyCothran" version="1.1"
 <<O>>  Difference Topic XeniaTableSchema (r1.11 - 28 Oct 2006 - JeremyCothran)

Xenia Table Schema

Line: 25 to 25

Temporal Table Design

Changed:
<
<
Both schemas would use the existing strategy of using the same table type/schema(multi_obs) for holding certain time periods of data
  • latest data available
  • separate tables for time span of 2 days, 2 weeks, 2 months, 2 years
>
>
Schemas use the strategy of using the same table type/schema(multi_obs) for holding smaller/larger time periods of data
  • table of latest or past few hours of data available (small size tables)
  • tables for past 2 weeks (medium size tables)
  • tables for older than 2 weeks (large size tables)

  • file archives produced by month broken out by both observation type(all platforms for a specific observation type) and platform(all observation types for a specific platform). Current month is a daily appended file with past days data.
  • data cascades from smaller, more recent tables to larger archival tables/files
 <<O>>  Difference Topic XeniaTableSchema (r1.10 - 28 Oct 2006 - JeremyCothran)

Xenia Table Schema

Line: 154 to 154

Every user belongs to their own default group. Groups can be additionally defined as a collection of users.

Added:
>
>

Schema changes

October 28, 2025 added to table organization columns url and opendap_url


Conventions

column names

Line: 175 to 179

META FILEATTACHMENT obs_data_dictionary.sql attr="" comment="NA" date="1161895553" path="obs_data_dictionary.sql" size="4893" user="JeremyCothran" version="1.2"
META FILEATTACHMENT db_multi_obs_beta_support1.sql attr="" comment="NA" date="1149021440" path="db_multi_obs_beta_support1.sql" size="2192" user="JeremyCothran" version="1.1"
Changed:
<
<
META FILEATTACHMENT db_xenia_v1_simple_schema.sql attr="" comment="NA" date="1161899217" path="C:\Documents and Settings\logan\Desktop\db_xenia_v1_simple_schema.sql" size="10486" user="JeremyCothran" version="1.1"
>
>
META FILEATTACHMENT db_xenia_v1_simple_schema.sql attr="" comment="NA" date="1162037194" path="db_xenia_v1_simple_schema.sql" size="10558" user="JeremyCothran" version="1.2"

META FILEATTACHMENT db_xenia_v1_extra_schema.sql attr="" comment="NA" date="1161899237" path="C:\Documents and Settings\logan\Desktop\db_xenia_v1_extra_schema.sql" size="8519" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_organization.sql attr="" comment="NA" date="1161899263" path="C:\Documents and Settings\logan\Desktop\insert_organization.sql" size="1497" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_platform_type.sql attr="" comment="NA" date="1161899282" path="C:\Documents and Settings\logan\Desktop\insert_platform_type.sql" size="846" user="JeremyCothran" version="1.1"
 <<O>>  Difference Topic XeniaTableSchema (r1.9 - 27 Oct 2006 - JeremyCothran)

Xenia Table Schema

Line: 28 to 28

Both schemas would use the existing strategy of using the same table type/schema(multi_obs) for holding certain time periods of data
  • latest data available
  • separate tables for time span of 2 days, 2 weeks, 2 months, 2 years
Changed:
<
<
  • file archives produced by month broken out by both observation type(all platforms for a specific observation type) and platform(all observation types for a specific platform)
>
>
  • file archives produced by month broken out by both observation type(all platforms for a specific observation type) and platform(all observation types for a specific platform). Current month is a daily appended file with past days data.

  • data cascades from smaller, more recent tables to larger archival tables/files

This allows queries on recent data to respond quickly and places a certain limit on how large any one table might get for indexing or backup purposes.

 <<O>>  Difference Topic XeniaTableSchema (r1.8 - 26 Oct 2006 - JeremyCothran)

Xenia Table Schema

Line: 21 to 21

http://nautilus.baruch.sc.edu/twiki_dmcc/bin/view/Main/CtdNotes

Deleted:
<
<
For HF Radar we'll want to track u/v vectors, so I'll probably specify a general observations table with 8 possible value columns - so that I can track from 2 to 8 associated data observation components(making an assumption that 8 columns should be generally large enough for now - could specify these additional vector components as small(1), medium(8), large(16) and so on if needed). I don't mind several empty columns for this type of scenario since when I archive data I'll use compression and unused columns should hopefully compress well.

The newer schema for me represents what I'd like to move to as the old schema isn't as generalized as I'd like for going forward with new data or products. The old schema uses separate similar tables for each observation type, whereas the new tries to stick with one table type and uses an observation index. The old schema also mixes in product specific(mostly MapServer? GIS specific in our case) columns like 'top of the hour', etc which create a development/maintenance tax on users who might not be interested in those particular products.
Changed:
<
<
Both schemas would use the existing strategy of using the same table type for holding certain time periods of data - say one database holds the past 2 weeks worth of data - others hold older archival data(same table format) broken apart by yearly reference. This allows queries on recent data to respond quickly and places a certain limit on how large any one table might get for indexing or backup purposes.
>
>

Temporal Table Design

Both schemas would use the existing strategy of using the same table type/schema(multi_obs) for holding certain time periods of data

  • latest data available
  • separate tables for time span of 2 days, 2 weeks, 2 months, 2 years
  • file archives produced by month broken out by both observation type(all platforms for a specific observation type) and platform(all observation types for a specific platform)
  • data cascades from smaller, more recent tables to larger archival tables/files

This allows queries on recent data to respond quickly and places a certain limit on how large any one table might get for indexing or backup purposes.


Schema and lookup SQL source

Changed:
<
<
The full schema dump using pg_dump is available here. Note that there's a lot of default Postgis stuff that I'd recommend just ignoring and just focusing on the tables listed in the above schema diagram.
>
>

Simple schema

The simple schema dump of just the basic table components for capturing observation data is availabe here

A sample observation data dictionary population SQL is available here. This contains most of the currently collected observation types for the existing Seacoos database.

To install this table(assuming Postgres already installed) run

#as user postgres
createdb db_xenia_v1
##tables repopulated in following order
#install the base tables
psql -d db_xenia_v1 -f db_xenia_v1_simple_schema.sql
#if want/need, add postgis and 'the_geom' to multi_obs table
#install the observation data dictionary
psql -d db_xenia_v1 -f obs_data_dictionary.sql

I've removed any references to PostGIS? from earlier(the multi_obs table used to contain a 'the_geom' column to store long/lat values) to help keep things simple/separate in the case a user doesn't want/need geospatial indexing or wants to use a different product/version than what I'm using.


NOTE The xenia schema is setup to run fine without reference to the quality control test tables and other table schemas to the right(in the diagram) of the multi_obs table. Be sure to disable any triggers on the multi-obs table which reference these additional functional tables which you may not be using.

Changed:
<
<
A few sample observation data dictionary population SQL is available here. I haven't had time to populate this with the full Seacoos data dictionary listing, it's just a few meteorological observation types, but it should give the general idea.
>
>

Sample organization/platform/sensor records

A sample organization,platform_type,platform,sensor_type,sensor population SQL is available here. I haven't had time to populate more fully but it should be enough to get started with the buoy data processing example listed here and give the general idea.

A full example listing is as follows

  • organization
  • platform_type
  • platform
  • sensor_type
  • sensor

To install these tables run

#organization/platform/sensor lookups
#don't run as is - for new regional areas, edit inserts to reflect regional organization, platform_type,sensor_type
##tables repopulated in following order
psql -d db_xenia_v1 -f insert_organization.sql
psql -d db_xenia_v1 -f insert_platform_type.sql
psql -d db_xenia_v1 -f insert_platform.sql
psql -d db_xenia_v1 -f insert_sensor_type.sql
psql -d db_xenia_v1 -f insert_sensor.sql

Extra schema

An extended schema which uses a trigger from the multi_obs table to activate quality control tests and user/group notification is available here

To install these extra tables run


Changed:
<
<
A sample organization,platform_type,platform,sensor_type,sensor population SQL is available here. I haven't had time to populate more fully but it should be enough to get started with the buoy data processing example listed here and give the general idea.
>
>
psql -d db_xenia_v1 -f db_xenia_v1_extra_schema.sql

Schema discussion

Line: 111 to 173

-- JeremyCothran - 26 May 2025

Changed:
<
<
META FILEATTACHMENT db_multi_obs_beta_schema.sql attr="" comment="NA" date="1149001882" path="db_multi_obs_beta_schema.sql" size="151940" user="JeremyCothran" version="1.1"
META FILEATTACHMENT obs_data_dictionary.sql attr="" comment="NA" date="1149001902" path="obs_data_dictionary.sql" size="1581" user="JeremyCothran" version="1.1"
>
>
META FILEATTACHMENT obs_data_dictionary.sql attr="" comment="NA" date="1161895553" path="obs_data_dictionary.sql" size="4893" user="JeremyCothran" version="1.2"

META FILEATTACHMENT db_multi_obs_beta_support1.sql attr="" comment="NA" date="1149021440" path="db_multi_obs_beta_support1.sql" size="2192" user="JeremyCothran" version="1.1"
Added:
>
>
META FILEATTACHMENT db_xenia_v1_simple_schema.sql attr="" comment="NA" date="1161899217" path="C:\Documents and Settings\logan\Desktop\db_xenia_v1_simple_schema.sql" size="10486" user="JeremyCothran" version="1.1"
META FILEATTACHMENT db_xenia_v1_extra_schema.sql attr="" comment="NA" date="1161899237" path="C:\Documents and Settings\logan\Desktop\db_xenia_v1_extra_schema.sql" size="8519" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_organization.sql attr="" comment="NA" date="1161899263" path="C:\Documents and Settings\logan\Desktop\insert_organization.sql" size="1497" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_platform_type.sql attr="" comment="NA" date="1161899282" path="C:\Documents and Settings\logan\Desktop\insert_platform_type.sql" size="846" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_platform.sql attr="" comment="NA" date="1161899301" path="C:\Documents and Settings\logan\Desktop\insert_platform.sql" size="23377" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_sensor_type.sql attr="" comment="NA" date="1161899319" path="C:\Documents and Settings\logan\Desktop\insert_sensor_type.sql" size="2402" user="JeremyCothran" version="1.1"
META FILEATTACHMENT insert_sensor.sql attr="" comment="NA" date="1161899337" path="C:\Documents and Settings\logan\Desktop\insert_sensor.sql" size="136052" user="JeremyCothran" version="1.1"
 <<O>>  Difference Topic XeniaTableSchema (r1.7 - 19 Jul 2006 - JeremyCothran)

Xenia Table Schema

Line: 31 to 31

The full schema dump using pg_dump is available here. Note that there's a lot of default Postgis stuff that I'd recommend just ignoring and just focusing on the tables listed in the above schema diagram.

Added:
>
>
NOTE The xenia schema is setup to run fine without reference to the quality control test tables and other table schemas to the right(in the diagram) of the multi_obs table. Be sure to disable any triggers on the multi-obs table which reference these additional functional tables which you may not be using.

A few sample observation data dictionary population SQL is available here. I haven't had time to populate this with the full Seacoos data dictionary listing, it's just a few meteorological observation types, but it should give the general idea.

A sample organization,platform_type,platform,sensor_type,sensor population SQL is available here. I haven't had time to populate more fully but it should be enough to get started with the buoy data processing example listed here and give the general idea.

 <<O>>  Difference Topic XeniaTableSchema (r1.6 - 08 Jun 2006 - JeremyCothran)

Xenia Table Schema

Line: 23 to 23

For HF Radar we'll want to track u/v vectors, so I'll probably specify a general observations table with 8 possible value columns - so that I can track from 2 to 8 associated data observation components(making an assumption that 8 columns should be generally large enough for now - could specify these additional vector components as small(1), medium(8), large(16) and so on if needed). I don't mind several empty columns for this type of scenario since when I archive data I'll use compression and unused columns should hopefully compress well.

Added:
>
>
The newer schema for me represents what I'd like to move to as the old schema isn't as generalized as I'd like for going forward with new data or products. The old schema uses separate similar tables for each observation type, whereas the new tries to stick with one table type and uses an observation index. The old schema also mixes in product specific(mostly MapServer? GIS specific in our case) columns like 'top of the hour', etc which create a development/maintenance tax on users who might not be interested in those particular products.

Both schemas would use the existing strategy of using the same table type for holding certain time periods of data - say one database holds the past 2 weeks worth of data - others hold older archival data(same table format) broken apart by yearly reference. This allows queries on recent data to respond quickly and places a certain limit on how large any one table might get for indexing or backup purposes.


Schema and lookup SQL source

 <<O>>  Difference Topic XeniaTableSchema (r1.5 - 05 Jun 2006 - JeremyCothran)

Xenia Table Schema

Line: 17 to 17

Note: The above table schema is primarily oriented towards platform/sensor type setups like buoys, water level stations, ship obs, etc. I'll probably suggest other similar observation table reference schemas for collections, grid, particle trajectory, etc datatypes that are sufficiently different as to need their own specialized schema.

Added:
>
>
My general strategy with the database design is to try to develop a single general scheme that can capture the less dynamic metadata like organization/platform/sensor for everyone and a small set of observation table sub-schemas(say < 5 for now) depending on the particular datatype and it's additional indexing columns or number of dimensions. For instance for CTD's we also track the 'collection_id' column which is an additional index to specify observations within a specific cast.

http://nautilus.baruch.sc.edu/twiki_dmcc/bin/view/Main/CtdNotes

For HF Radar we'll want to track u/v vectors, so I'll probably specify a general observations table with 8 possible value columns - so that I can track from 2 to 8 associated data observation components(making an assumption that 8 columns should be generally large enough for now - could specify these additional vector components as small(1), medium(8), large(16) and so on if needed). I don't mind several empty columns for this type of scenario since when I archive data I'll use compression and unused columns should hopefully compress well.


Schema and lookup SQL source

The full schema dump using pg_dump is available here. Note that there's a lot of default Postgis stuff that I'd recommend just ignoring and just focusing on the tables listed in the above schema diagram.

 <<O>>  Difference Topic XeniaTableSchema (r1.4 - 30 May 2006 - JeremyCothran)

Xenia Table Schema

Line: 23 to 23

A few sample observation data dictionary population SQL is available here. I haven't had time to populate this with the full Seacoos data dictionary listing, it's just a few meteorological observation types, but it should give the general idea.

Added:
>
>
A sample organization,platform_type,platform,sensor_type,sensor population SQL is available here. I haven't had time to populate more fully but it should be enough to get started with the buoy data processing example listed here and give the general idea.

Schema discussion

The schema as shown in the diagram above has been color-coded grouped into it's different functional aspects:

Line: 57 to 59

Tests which are periodically performed on the observations as they arrive.

Added:
>
>
Tests must also pass the following criteria:

  • they are active (active flag=true)
  • the test is within the effective date range (eff_date_begin to eff_date_end)
  • they should not be ignored (ignore flag=false)
  • the wait_interval has expired. wait_interval is measured in minutes. wait_interval expiration time = done_date time + the wait_interval time

The recurring flag is used to reset the effective date range one year ahead as it expires which enables tests to be seasonally enabled from year to year.


Test Actions

Actions which are taken as a result of a test failure.

Line: 90 to 101

META FILEATTACHMENT db_multi_obs_beta_schema.sql attr="" comment="NA" date="1149001882" path="db_multi_obs_beta_schema.sql" size="151940" user="JeremyCothran" version="1.1"
META FILEATTACHMENT obs_data_dictionary.sql attr="" comment="NA" date="1149001902" path="obs_data_dictionary.sql" size="1581" user="JeremyCothran" version="1.1"
Added:
>
>
META FILEATTACHMENT db_multi_obs_beta_support1.sql attr="" comment="NA" date="1149021440" path="db_multi_obs_beta_support1.sql" size="2192" user="JeremyCothran" version="1.1"
 <<O>>  Difference Topic XeniaTableSchema (r1.3 - 30 May 2006 - JeremyCothran)

Xenia Table Schema

Line: 15 to 15

http://nautilus.baruch.sc.edu/twiki_dmcc/bin/view/Main/MultiObsSchema

Added:
>
>
Note: The above table schema is primarily oriented towards platform/sensor type setups like buoys, water level stations, ship obs, etc. I'll probably suggest other similar observation table reference schemas for collections, grid, particle trajectory, etc datatypes that are sufficiently different as to need their own specialized schema.

Schema and lookup SQL source

The full schema dump using pg_dump is available here. Note that there's a lot of default Postgis stuff that I'd recommend just ignoring and just focusing on the tables listed in the above schema diagram.

Line: 31 to 33

Platforms/Sensors/Observations

Changed:
<
<
Metadata concerning the platforms and sensors. Observations separately indexed by observation type(measurement type or 'm_type'), time and location.
>
>
Metadata concerning the platforms and sensors. Observations separately indexed on the multi_obs table by observation type(measurement type or 'm_type'), time and location.

multi_obs table

The multi-obs table includes fields for row_entry_date and row_update_date to help determine latencies between observations made and when they are collected.

On the multi_obs table the field platform_handle is the same format as station_id referenced in earlier schemas - a concatenation of organization(short_name)_platform(short_name)_platform_type(type_name) like carocoops_CAP2_buoy

The multi_obs table is the only PostGIS? enabled table. There is a trigger which auto-updates the_geom field for an inserted long and lat.

The multi-obs table also includes an auto-update trigger to set the qc test table ignore flag to false so the qc test will be re-run on the next qc processing.


Observations Data Dictionary

 <<O>>  Difference Topic XeniaTableSchema (r1.2 - 30 May 2006 - JeremyCothran)

Xenia Table Schema

Line: 15 to 15

http://nautilus.baruch.sc.edu/twiki_dmcc/bin/view/Main/MultiObsSchema

Added:
>
>

Schema and lookup SQL source

The full schema dump using pg_dump is available here. Note that there's a lot of default Postgis stuff that I'd recommend just ignoring and just focusing on the tables listed in the above schema diagram.

A few sample observation data dictionary population SQL is available here. I haven't had time to populate this with the full Seacoos data dictionary listing, it's just a few meteorological observation types, but it should give the general idea.


Schema discussion

The schema as shown in the diagram above has been color-coded grouped into it's different functional aspects:

Line: 70 to 76

-- JeremyCothran - 26 May 2025

Added:
>
>
META FILEATTACHMENT db_multi_obs_beta_schema.sql attr="" comment="NA" date="1149001882" path="db_multi_obs_beta_schema.sql" size="151940" user="JeremyCothran" version="1.1"
META FILEATTACHMENT obs_data_dictionary.sql attr="" comment="NA" date="1149001902" path="obs_data_dictionary.sql" size="1581" user="JeremyCothran" version="1.1"
 <<O>>  Difference Topic XeniaTableSchema (r1.1 - 26 May 2006 - JeremyCothran)
Line: 1 to 1
Added:
>
>
Xenia Table Schema

History

This table schema is the latest adaptation from earlier approaches documented earlier at

http://nautilus.baruch.sc.edu/twiki_dmcc/bin/view/Main/SEACOOSCookbook2#Data_structures_canonical_forms

http://nautilus.baruch.sc.edu/twiki_dmcc/bin/view/Main/MultiObsSchema

Schema discussion

The schema as shown in the diagram above has been color-coded grouped into it's different functional aspects:

Organization/Project/Catalog

Metadata concerning the organization or institution and projects or catalogs developed within that organization.

Platforms/Sensors/Observations

Metadata concerning the platforms and sensors. Observations separately indexed by observation type(measurement type or 'm_type'), time and location.

Observations Data Dictionary

The 'm_type' table is a data dictionary which references a standard_name and unit of measure(uom).


Note the following sections are less finished and more developmental. The system could perform with just the tables above in relation to collecting and sharing observations without actually getting into further functionality like quality control test , test actions and notification.

Quality Control Tests

Tests which are periodically performed on the observations as they arrive.

Test Actions

Actions which are taken as a result of a test failure.

Email Notification

Actions which are email oriented specifying a particular message, importance and user/group to be notified.

Groups/Users

Every user belongs to their own default group. Groups can be additionally defined as a collection of users.

Conventions

column names

Tried to avoid using column names which are SQL or PostgreSQL? reserved words using the listing at
http://www.php-editors.com/postgres_manual/p_sql-keywords-appendix.html

In some instances the reserved word was very useful, so to use the word without conflicting with it I'm prefixing these words with 'app_' like 'app_user', 'app_group'.

row_id

All tables by design use an row_id column as the primary key and do not rely on concatenated columns for primary key use. In most cases the row_id is a SERIAL type which provides for automatic indexing.

additional attributes/columns

To provide some flexibility for additional column type information, but without a dedicated table column, I've added support tables of '_attr' for sensor_attr and test_attr. These support tables provide a attribute string label and value which references a particular row_id.

-- JeremyCothran - 26 May 2025

Revision r1.1 - 26 May 2025 - 19:44 - JeremyCothran
Revision r1.18 - 16 Feb 2025 - 16:23 - JeremyCothran