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
| ||||||||||
| Line: 196 to 198 | ||||||||||
| ||||||||||
| Changed: | ||||||||||
| < < |
| |||||||||
| > > |
| |||||||||
| ||||||||||
Xenia Table Schema
| ||||||||||
| Line: 196 to 196 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
| Changed: | ||||||||||
| < < |
| |||||||||
| > > |
| |||||||||
| ||||||||||
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
| |||||||
Observations Data Dictionary | ||||||||
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 | ||||||||||
| ||||||||||
| Added: | ||||||||||
| > > |
| |||||||||
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: | |||||||||||||||||||
| > > |
| ||||||||||||||||||
Conventions | |||||||||||||||||||
| Line: 188 to 191 | |||||||||||||||||||
| |||||||||||||||||||
| Changed: | |||||||||||||||||||
| < < |
| ||||||||||||||||||
| > > |
| ||||||||||||||||||
| |||||||||||||||||||
| Added: | |||||||||||||||||||
| > > |
| ||||||||||||||||||
Xenia Table Schema
| ||||||||||
| Line: 158 to 158 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
Schema changesOctober 28, 2025 added to table organization columns url and opendap_url | ||||||||||
| Added: | ||||||||||
| > > |
November 15, 2025
| |||||||||
Conventions | ||||||||||
| Line: 178 to 181 | ||||||||||
| -- JeremyCothran - 26 May 2025 | ||||||||||
| Changed: | ||||||||||
| < < |
| |||||||||
| > > |
| |||||||||
| ||||||||||
| Changed: | ||||||||||
| < < |
| |||||||||
| > > |
| |||||||||
| ||||||||||
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
| |||||||
| > > |
Schemas use the strategy of using the same table type/schema(multi_obs) for holding smaller/larger time periods of data
| |||||||
| ||||||||
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 changesOctober 28, 2025 added to table organization columns url and opendap_url | |||||||||
Conventionscolumn names | ||||||||||
| Line: 175 to 179 | ||||||||||
| ||||||||||
| Changed: | ||||||||||
| < < |
| |||||||||
| > > |
| |||||||||
| ||||||||||
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
| ||||||||
| Changed: | ||||||||
| < < |
| |||||||
| > > |
| |||||||
| ||||||||
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 DesignBoth schemas would use the existing strategy of using the same table type/schema(multi_obs) for holding certain time periods of data
| |||||||||||||||||||||
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 schemaThe 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.sqlI'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 recordsA 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/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 schemaAn 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: | ||||||||||||||||||||||
| < < |
| |||||||||||||||||||||
| > > |
| |||||||||||||||||||||
| ||||||||||||||||||||||
| Added: | ||||||||||||||||||||||
| > > |
| |||||||||||||||||||||
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. | ||||||||
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 | ||||||||
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 sourceThe 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. | ||||||||
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 discussionThe 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:
| |||||||
Test ActionsActions which are taken as a result of a test failure. | ||||||||
| Line: 90 to 101 | ||||||||
| ||||||||
| Added: | ||||||||
| > > |
| |||||||
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 sourceThe 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 tableThe 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 | ||||||||
Xenia Table Schema
| ||||||||
| Line: 15 to 15 | ||||||||
|---|---|---|---|---|---|---|---|---|
| http://nautilus.baruch.sc.edu/twiki_dmcc/bin/view/Main/MultiObsSchema | ||||||||
| Added: | ||||||||
| > > |
Schema and lookup SQL sourceThe 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 discussionThe 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: | ||||||||
| > > |
| |||||||
| Line: 1 to 1 | ||||||||
|---|---|---|---|---|---|---|---|---|
| Added: | ||||||||
| > > |
Xenia Table Schema
HistoryThis 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/MultiObsSchemaSchema discussionThe schema as shown in the diagram above has been color-coded grouped into it's different functional aspects:Organization/Project/CatalogMetadata concerning the organization or institution and projects or catalogs developed within that organization.Platforms/Sensors/ObservationsMetadata concerning the platforms and sensors. Observations separately indexed by observation type(measurement type or 'm_type'), time and location.Observations Data DictionaryThe '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 TestsTests which are periodically performed on the observations as they arrive.Test ActionsActions which are taken as a result of a test failure.Email NotificationActions which are email oriented specifying a particular message, importance and user/group to be notified.Groups/UsersEvery user belongs to their own default group. Groups can be additionally defined as a collection of users.Conventionscolumn namesTried to avoid using column names which are SQL or PostgreSQL? reserved words using the listing athttp://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_idAll 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/columnsTo 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 | |||||||