Changeset f6540baac0ed25babb2a91d9b715988abb653bcb

Show
Ignore:
Timestamp:
06/15/09 23:07:39 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1245107259 +0000
git-parent:

[c87819bbb246f0af528349af329cfbf861ea0afc]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1245107259 +0000
Message:

flag-day(stratcond,database) partition the loading docks, refs #140

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sql/crontab

    rea0809f rf6540ba  
    6603 00,06,12 * * * /opt/pgsql835/bin/psql -d reconnoiter -U stratcon -c "select stratcon.rollup_matrix_numeric_12hours();" >/tmp/rollup_12hours.log 2>&1 
    77#cleanup jobs 
     801 00 * * * /opt/pgsql835/bin/psql -d reconnoiter -U reconnoiter -c "select stratcon.archive_part_maint('stratcon.loading_dock_metric_numeric_archive');" 1>/dev/null 
     901 00 * * * /opt/pgsql835/bin/psql -d reconnoiter -U reconnoiter -c "select stratcon.archive_part_maint('stratcon.loading_dock_metric_text_archive');" 1>/dev/null 
     1001 00 * * * /opt/pgsql835/bin/psql -d reconnoiter -U reconnoiter -c "select stratcon.archive_part_maint('stratcon.loading_dock_status_archive');" 1>/dev/null 
    81101 00 * * * /opt/pgsql835/bin/psql -d reconnoiter -c "delete from prism.saved_graphs where saved = false and last_update<current_timestamp - '1 day' ::interval;" 1>/dev/null 
  • sql/reconnoiter_ddl_dump.sql

    r9d38c65 rf6540ba  
    1010 
    1111-- 
    12 -- Name: otools; Type: SCHEMA; Schema: -; Owner: postgres 
    13 -- 
    14  
    15 CREATE SCHEMA otools; 
    16  
    17  
    18 ALTER SCHEMA otools OWNER TO postgres; 
    19  
    20 -- 
    2112-- Name: prism; Type: SCHEMA; Schema: -; Owner: prism 
    2213-- 
     
    3627ALTER SCHEMA stratcon OWNER TO stratcon; 
    3728 
    38 -- 
    39 -- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: omniti 
    40 -- 
    41  
    42 CREATE PROCEDURAL LANGUAGE plpgsql; 
    43  
    44  
    45 ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO omniti; 
    46  
    47 SET search_path = otools, pg_catalog; 
     29SET search_path = prism, pg_catalog; 
    4830 
    4931SET default_tablespace = ''; 
    5032 
    5133SET default_with_oids = false; 
    52  
    53 -- 
    54 -- Name: table_growth; Type: TABLE; Schema: otools; Owner: postgres; Tablespace:  
    55 -- 
    56  
    57 CREATE TABLE table_growth ( 
    58     table_owner text NOT NULL, 
    59     schema_name text NOT NULL, 
    60     table_name text NOT NULL, 
    61     actual_size numeric NOT NULL, 
    62     growth_size numeric NOT NULL, 
    63     sum_flag smallint NOT NULL, 
    64     capture_time date NOT NULL 
    65 ); 
    66  
    67  
    68 ALTER TABLE otools.table_growth OWNER TO postgres; 
    69  
    70 SET search_path = prism, pg_catalog; 
    7134 
    7235-- 
     
    144107ALTER TABLE prism.saved_worksheets_dep OWNER TO reconnoiter; 
    145108 
    146 SET search_path = public, pg_catalog; 
    147  
    148 SET default_with_oids = true; 
    149  
    150 -- 
    151 -- Name: pga_diagrams; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
    152 -- 
    153  
    154 CREATE TABLE pga_diagrams ( 
    155     diagramname character varying(64) NOT NULL, 
    156     diagramtables text, 
    157     diagramlinks text 
    158 ); 
    159  
    160  
    161 ALTER TABLE public.pga_diagrams OWNER TO reconnoiter; 
    162  
    163 -- 
    164 -- Name: pga_forms; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
    165 -- 
    166  
    167 CREATE TABLE pga_forms ( 
    168     formname character varying(64) NOT NULL, 
    169     formsource text 
    170 ); 
    171  
    172  
    173 ALTER TABLE public.pga_forms OWNER TO reconnoiter; 
    174  
    175 -- 
    176 -- Name: pga_graphs; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
    177 -- 
    178  
    179 CREATE TABLE pga_graphs ( 
    180     graphname character varying(64) NOT NULL, 
    181     graphsource text, 
    182     graphcode text 
    183 ); 
    184  
    185  
    186 ALTER TABLE public.pga_graphs OWNER TO reconnoiter; 
    187  
    188 -- 
    189 -- Name: pga_images; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
    190 -- 
    191  
    192 CREATE TABLE pga_images ( 
    193     imagename character varying(64) NOT NULL, 
    194     imagesource text 
    195 ); 
    196  
    197  
    198 ALTER TABLE public.pga_images OWNER TO reconnoiter; 
    199  
    200 -- 
    201 -- Name: pga_layout; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
    202 -- 
    203  
    204 CREATE TABLE pga_layout ( 
    205     tablename character varying(64) NOT NULL, 
    206     nrcols smallint, 
    207     colnames text, 
    208     colwidth text 
    209 ); 
    210  
    211  
    212 ALTER TABLE public.pga_layout OWNER TO reconnoiter; 
    213  
    214 -- 
    215 -- Name: pga_queries; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
    216 -- 
    217  
    218 CREATE TABLE pga_queries ( 
    219     queryname character varying(64) NOT NULL, 
    220     querytype character(1), 
    221     querycommand text, 
    222     querytables text, 
    223     querylinks text, 
    224     queryresults text, 
    225     querycomments text 
    226 ); 
    227  
    228  
    229 ALTER TABLE public.pga_queries OWNER TO reconnoiter; 
    230  
    231 -- 
    232 -- Name: pga_reports; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
    233 -- 
    234  
    235 CREATE TABLE pga_reports ( 
    236     reportname character varying(64) NOT NULL, 
    237     reportsource text, 
    238     reportbody text, 
    239     reportprocs text, 
    240     reportoptions text 
    241 ); 
    242  
    243  
    244 ALTER TABLE public.pga_reports OWNER TO reconnoiter; 
    245  
    246 -- 
    247 -- Name: pga_scripts; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
    248 -- 
    249  
    250 CREATE TABLE pga_scripts ( 
    251     scriptname character varying(64) NOT NULL, 
    252     scriptsource text 
    253 ); 
    254  
    255  
    256 ALTER TABLE public.pga_scripts OWNER TO reconnoiter; 
    257  
    258 SET default_with_oids = false; 
    259  
    260 -- 
    261 -- Name: v_recent_part; Type: TABLE; Schema: public; Owner: reconnoiter; Tablespace:  
    262 -- 
    263  
    264 CREATE TABLE v_recent_part ( 
    265     date date 
    266 ); 
    267  
    268  
    269 ALTER TABLE public.v_recent_part OWNER TO reconnoiter; 
    270  
    271109SET search_path = stratcon, pg_catalog; 
    272110 
     
    357195 
    358196-- 
    359 -- Name: loading_dock_metric_numeric_archive_200812; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    360 -- 
    361  
    362 CREATE TABLE loading_dock_metric_numeric_archive_200812 (CONSTRAINT check_loading_dock_metric_numeric_archive_200812 CHECK (((whence >= '2008-11-30 19:00:00-05'::timestamp with time zone) AND (whence < '2008-12-31 19:00:00-05'::timestamp with time zone))) 
    363 ) 
    364 INHERITS (loading_dock_metric_numeric_archive); 
    365  
    366  
    367 ALTER TABLE stratcon.loading_dock_metric_numeric_archive_200812 OWNER TO reconnoiter; 
    368  
    369 -- 
    370 -- Name: loading_dock_metric_numeric_archive_200901; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    371 -- 
    372  
    373 CREATE TABLE loading_dock_metric_numeric_archive_200901 (CONSTRAINT check_loading_dock_metric_numeric_archive_200901 CHECK (((whence >= '2008-12-31 19:00:00-05'::timestamp with time zone) AND (whence < '2009-01-31 19:00:00-05'::timestamp with time zone))) 
    374 ) 
    375 INHERITS (loading_dock_metric_numeric_archive); 
    376  
    377  
    378 ALTER TABLE stratcon.loading_dock_metric_numeric_archive_200901 OWNER TO reconnoiter; 
    379  
    380 -- 
    381 -- Name: loading_dock_metric_numeric_archive_200902; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    382 -- 
    383  
    384 CREATE TABLE loading_dock_metric_numeric_archive_200902 (CONSTRAINT check_loading_dock_metric_numeric_archive_200902 CHECK (((whence >= '2009-01-31 19:00:00-05'::timestamp with time zone) AND (whence < '2009-02-28 19:00:00-05'::timestamp with time zone))) 
    385 ) 
    386 INHERITS (loading_dock_metric_numeric_archive); 
    387  
    388  
    389 ALTER TABLE stratcon.loading_dock_metric_numeric_archive_200902 OWNER TO reconnoiter; 
    390  
    391 -- 
    392 -- Name: loading_dock_metric_numeric_archive_200903; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    393 -- 
    394  
    395 CREATE TABLE loading_dock_metric_numeric_archive_200903 (CONSTRAINT check_loading_dock_metric_numeric_archive_200903 CHECK (((whence >= '2009-02-28 19:00:00-05'::timestamp with time zone) AND (whence < '2009-03-31 20:00:00-04'::timestamp with time zone))) 
    396 ) 
    397 INHERITS (loading_dock_metric_numeric_archive); 
    398  
    399  
    400 ALTER TABLE stratcon.loading_dock_metric_numeric_archive_200903 OWNER TO reconnoiter; 
    401  
    402 -- 
    403 -- Name: loading_dock_metric_numeric_archive_200904; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    404 -- 
    405  
    406 CREATE TABLE loading_dock_metric_numeric_archive_200904 (CONSTRAINT check_loading_dock_metric_numeric_archive_200904 CHECK (((whence >= '2009-03-31 20:00:00-04'::timestamp with time zone) AND (whence < '2009-04-30 20:00:00-04'::timestamp with time zone))) 
    407 ) 
    408 INHERITS (loading_dock_metric_numeric_archive); 
    409  
    410  
    411 ALTER TABLE stratcon.loading_dock_metric_numeric_archive_200904 OWNER TO reconnoiter; 
    412  
    413 -- 
    414 -- Name: loading_dock_metric_numeric_archive_200905; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    415 -- 
    416  
    417 CREATE TABLE loading_dock_metric_numeric_archive_200905 (CONSTRAINT check_loading_dock_metric_numeric_archive_200905 CHECK (((whence >= '2009-04-30 20:00:00-04'::timestamp with time zone) AND (whence < '2009-05-31 20:00:00-04'::timestamp with time zone))) 
    418 ) 
    419 INHERITS (loading_dock_metric_numeric_archive); 
    420  
    421  
    422 ALTER TABLE stratcon.loading_dock_metric_numeric_archive_200905 OWNER TO reconnoiter; 
    423  
    424 -- 
    425 -- Name: loading_dock_metric_numeric_archive_200906; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    426 -- 
    427  
    428 CREATE TABLE loading_dock_metric_numeric_archive_200906 (CONSTRAINT check_loading_dock_metric_numeric_archive_200906 CHECK (((whence >= '2009-05-31 20:00:00-04'::timestamp with time zone) AND (whence < '2009-06-30 20:00:00-04'::timestamp with time zone))) 
    429 ) 
    430 INHERITS (loading_dock_metric_numeric_archive); 
    431  
    432  
    433 ALTER TABLE stratcon.loading_dock_metric_numeric_archive_200906 OWNER TO reconnoiter; 
    434  
    435 -- 
    436 -- Name: loading_dock_metric_numeric_archive_200907; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    437 -- 
    438  
    439 CREATE TABLE loading_dock_metric_numeric_archive_200907 (CONSTRAINT check_loading_dock_metric_numeric_archive_200907 CHECK (((whence >= '2009-06-30 20:00:00-04'::timestamp with time zone) AND (whence < '2009-07-31 20:00:00-04'::timestamp with time zone))) 
    440 ) 
    441 INHERITS (loading_dock_metric_numeric_archive); 
    442  
    443  
    444 ALTER TABLE stratcon.loading_dock_metric_numeric_archive_200907 OWNER TO reconnoiter; 
    445  
    446 -- 
    447197-- Name: loading_dock_metric_numeric_s; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    448198-- 
     
    488238 
    489239-- 
    490 -- Name: loading_dock_metric_text_archive_200806; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    491 -- 
    492  
    493 CREATE TABLE loading_dock_metric_text_archive_200806 (CONSTRAINT check_loading_dock_metric_text_archive_200806 CHECK (((whence >= '2008-05-31 20:00:00-04'::timestamp with time zone) AND (whence < '2008-06-30 20:00:00-04'::timestamp with time zone))) 
    494 ) 
    495 INHERITS (loading_dock_metric_text_archive); 
    496  
    497  
    498 ALTER TABLE stratcon.loading_dock_metric_text_archive_200806 OWNER TO reconnoiter; 
    499  
    500 -- 
    501 -- Name: loading_dock_metric_text_archive_200807; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    502 -- 
    503  
    504 CREATE TABLE loading_dock_metric_text_archive_200807 (CONSTRAINT check_loading_dock_metric_text_archive_200807 CHECK (((whence >= '2008-06-30 20:00:00-04'::timestamp with time zone) AND (whence < '2008-07-31 20:00:00-04'::timestamp with time zone))) 
    505 ) 
    506 INHERITS (loading_dock_metric_text_archive); 
    507  
    508  
    509 ALTER TABLE stratcon.loading_dock_metric_text_archive_200807 OWNER TO reconnoiter; 
    510  
    511 -- 
    512 -- Name: loading_dock_metric_text_archive_200808; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    513 -- 
    514  
    515 CREATE TABLE loading_dock_metric_text_archive_200808 (CONSTRAINT check_loading_dock_metric_text_archive_200808 CHECK (((whence >= '2008-07-31 20:00:00-04'::timestamp with time zone) AND (whence < '2008-08-31 20:00:00-04'::timestamp with time zone))) 
    516 ) 
    517 INHERITS (loading_dock_metric_text_archive); 
    518  
    519  
    520 ALTER TABLE stratcon.loading_dock_metric_text_archive_200808 OWNER TO reconnoiter; 
    521  
    522 -- 
    523 -- Name: loading_dock_metric_text_archive_200809; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    524 -- 
    525  
    526 CREATE TABLE loading_dock_metric_text_archive_200809 (CONSTRAINT check_loading_dock_metric_text_archive_200809 CHECK (((whence >= '2008-08-31 20:00:00-04'::timestamp with time zone) AND (whence < '2008-09-30 20:00:00-04'::timestamp with time zone))) 
    527 ) 
    528 INHERITS (loading_dock_metric_text_archive); 
    529  
    530  
    531 ALTER TABLE stratcon.loading_dock_metric_text_archive_200809 OWNER TO reconnoiter; 
    532  
    533 -- 
    534 -- Name: loading_dock_metric_text_archive_200810; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    535 -- 
    536  
    537 CREATE TABLE loading_dock_metric_text_archive_200810 (CONSTRAINT check_loading_dock_metric_text_archive_200810 CHECK (((whence >= '2008-09-30 20:00:00-04'::timestamp with time zone) AND (whence < '2008-10-31 20:00:00-04'::timestamp with time zone))) 
    538 ) 
    539 INHERITS (loading_dock_metric_text_archive); 
    540  
    541  
    542 ALTER TABLE stratcon.loading_dock_metric_text_archive_200810 OWNER TO reconnoiter; 
    543  
    544 -- 
    545 -- Name: loading_dock_metric_text_archive_200811; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    546 -- 
    547  
    548 CREATE TABLE loading_dock_metric_text_archive_200811 (CONSTRAINT check_loading_dock_metric_text_archive_200811 CHECK (((whence >= '2008-10-31 20:00:00-04'::timestamp with time zone) AND (whence < '2008-11-30 19:00:00-05'::timestamp with time zone))) 
    549 ) 
    550 INHERITS (loading_dock_metric_text_archive); 
    551  
    552  
    553 ALTER TABLE stratcon.loading_dock_metric_text_archive_200811 OWNER TO reconnoiter; 
    554  
    555 -- 
    556 -- Name: loading_dock_metric_text_archive_200812; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    557 -- 
    558  
    559 CREATE TABLE loading_dock_metric_text_archive_200812 (CONSTRAINT check_loading_dock_metric_text_archive_200812 CHECK (((whence >= '2008-11-30 19:00:00-05'::timestamp with time zone) AND (whence < '2008-12-31 19:00:00-05'::timestamp with time zone))) 
    560 ) 
    561 INHERITS (loading_dock_metric_text_archive); 
    562  
    563  
    564 ALTER TABLE stratcon.loading_dock_metric_text_archive_200812 OWNER TO reconnoiter; 
    565  
    566 -- 
    567 -- Name: loading_dock_metric_text_archive_200901; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    568 -- 
    569  
    570 CREATE TABLE loading_dock_metric_text_archive_200901 (CONSTRAINT check_loading_dock_metric_text_archive_200901 CHECK (((whence >= '2008-12-31 19:00:00-05'::timestamp with time zone) AND (whence < '2009-01-31 19:00:00-05'::timestamp with time zone))) 
    571 ) 
    572 INHERITS (loading_dock_metric_text_archive); 
    573  
    574  
    575 ALTER TABLE stratcon.loading_dock_metric_text_archive_200901 OWNER TO reconnoiter; 
    576  
    577 -- 
    578 -- Name: loading_dock_metric_text_archive_200902; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    579 -- 
    580  
    581 CREATE TABLE loading_dock_metric_text_archive_200902 (CONSTRAINT check_loading_dock_metric_text_archive_200902 CHECK (((whence >= '2009-01-31 19:00:00-05'::timestamp with time zone) AND (whence < '2009-02-28 19:00:00-05'::timestamp with time zone))) 
    582 ) 
    583 INHERITS (loading_dock_metric_text_archive); 
    584  
    585  
    586 ALTER TABLE stratcon.loading_dock_metric_text_archive_200902 OWNER TO reconnoiter; 
    587  
    588 -- 
    589 -- Name: loading_dock_metric_text_archive_200903; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    590 -- 
    591  
    592 CREATE TABLE loading_dock_metric_text_archive_200903 (CONSTRAINT check_loading_dock_metric_text_archive_200903 CHECK (((whence >= '2009-02-28 19:00:00-05'::timestamp with time zone) AND (whence < '2009-03-31 20:00:00-04'::timestamp with time zone))) 
    593 ) 
    594 INHERITS (loading_dock_metric_text_archive); 
    595  
    596  
    597 ALTER TABLE stratcon.loading_dock_metric_text_archive_200903 OWNER TO reconnoiter; 
    598  
    599 -- 
    600 -- Name: loading_dock_metric_text_archive_200904; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    601 -- 
    602  
    603 CREATE TABLE loading_dock_metric_text_archive_200904 (CONSTRAINT check_loading_dock_metric_text_archive_200904 CHECK (((whence >= '2009-03-31 20:00:00-04'::timestamp with time zone) AND (whence < '2009-04-30 20:00:00-04'::timestamp with time zone))) 
    604 ) 
    605 INHERITS (loading_dock_metric_text_archive); 
    606  
    607  
    608 ALTER TABLE stratcon.loading_dock_metric_text_archive_200904 OWNER TO reconnoiter; 
    609  
    610 -- 
    611 -- Name: loading_dock_metric_text_archive_200905; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    612 -- 
    613  
    614 CREATE TABLE loading_dock_metric_text_archive_200905 (CONSTRAINT check_loading_dock_metric_text_archive_200905 CHECK (((whence >= '2009-04-30 20:00:00-04'::timestamp with time zone) AND (whence < '2009-05-31 20:00:00-04'::timestamp with time zone))) 
    615 ) 
    616 INHERITS (loading_dock_metric_text_archive); 
    617  
    618  
    619 ALTER TABLE stratcon.loading_dock_metric_text_archive_200905 OWNER TO reconnoiter; 
    620  
    621 -- 
    622 -- Name: loading_dock_metric_text_archive_200906; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    623 -- 
    624  
    625 CREATE TABLE loading_dock_metric_text_archive_200906 (CONSTRAINT check_loading_dock_metric_text_archive_200906 CHECK (((whence >= '2009-05-31 20:00:00-04'::timestamp with time zone) AND (whence < '2009-06-30 20:00:00-04'::timestamp with time zone))) 
    626 ) 
    627 INHERITS (loading_dock_metric_text_archive); 
    628  
    629  
    630 ALTER TABLE stratcon.loading_dock_metric_text_archive_200906 OWNER TO reconnoiter; 
    631  
    632 -- 
    633 -- Name: loading_dock_metric_text_archive_200907; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    634 -- 
    635  
    636 CREATE TABLE loading_dock_metric_text_archive_200907 (CONSTRAINT check_loading_dock_metric_text_archive_200907 CHECK (((whence >= '2009-06-30 20:00:00-04'::timestamp with time zone) AND (whence < '2009-07-31 20:00:00-04'::timestamp with time zone))) 
    637 ) 
    638 INHERITS (loading_dock_metric_text_archive); 
    639  
    640  
    641 ALTER TABLE stratcon.loading_dock_metric_text_archive_200907 OWNER TO reconnoiter; 
    642  
    643 -- 
    644240-- Name: loading_dock_metric_text_s; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    645241-- 
     
    671267 
    672268-- 
    673 -- Name: loading_dock_status_s; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    674 -- 
    675  
    676 CREATE TABLE loading_dock_status_s
     269-- Name: loading_dock_status_archive; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
     270-- 
     271 
     272CREATE TABLE loading_dock_status_archive
    677273    sid integer NOT NULL, 
    678274    whence timestamp with time zone NOT NULL, 
     
    682278    status text 
    683279); 
     280 
     281 
     282ALTER TABLE stratcon.loading_dock_status_archive OWNER TO reconnoiter; 
     283 
     284-- 
     285-- Name: loading_dock_status_s; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
     286-- 
     287 
     288CREATE TABLE loading_dock_status_s ( 
     289    sid integer, 
     290    whence timestamp with time zone, 
     291    state character(1), 
     292    availability character(1), 
     293    duration integer, 
     294    status text 
     295) 
     296INHERITS (loading_dock_status_archive); 
    684297 
    685298 
     
    865478ALTER TABLE stratcon.rollup_runner OWNER TO reconnoiter; 
    866479 
    867 SET search_path = otools, pg_catalog; 
    868  
    869 -- 
    870 -- Name: collect_table_growth(); Type: FUNCTION; Schema: otools; Owner: postgres 
    871 -- 
    872  
    873 CREATE FUNCTION collect_table_growth() RETURNS void 
    874     AS $$ 
    875     insert into otools.table_growth (table_owner, schema_name, table_name, actual_size, growth_size, sum_flag, capture_time)  
    876     select pg_get_userbyid(c.relowner) AS table_owner, n.nspname AS schema_name, c.relname AS table_name, pg_total_relation_size(c.oid), 0, 0, current_date  
    877     from pg_class c JOIN pg_namespace n ON (c.relnamespace=n.oid) where relkind = 'r' and reltuples > 10000; 
    878 $$ 
    879     LANGUAGE sql; 
    880  
    881  
    882 ALTER FUNCTION otools.collect_table_growth() OWNER TO postgres; 
    883  
    884 -- 
    885 -- Name: quote_nullable(numeric); Type: FUNCTION; Schema: otools; Owner: postgres 
    886 -- 
    887  
    888 CREATE FUNCTION quote_nullable(numeric) RETURNS text 
    889     AS $_$ 
    890 SELECT CASE WHEN $1 IS NULL THEN 'NULL' ELSE $1::text END; 
    891 $_$ 
    892     LANGUAGE sql; 
    893  
    894  
    895 ALTER FUNCTION otools.quote_nullable(numeric) OWNER TO postgres; 
    896  
    897 -- 
    898 -- Name: quote_nullable(text); Type: FUNCTION; Schema: otools; Owner: postgres 
    899 -- 
    900  
    901 CREATE FUNCTION quote_nullable(text) RETURNS text 
    902     AS $_$ 
    903 SELECT CASE WHEN $1 IS NULL THEN 'NULL' ELSE quote_literal($1) END; 
    904 $_$ 
    905     LANGUAGE sql; 
    906  
    907  
    908 ALTER FUNCTION otools.quote_nullable(text) OWNER TO postgres; 
    909  
    910 -- 
    911 -- Name: quote_nullable(timestamp with time zone); Type: FUNCTION; Schema: otools; Owner: postgres 
    912 -- 
    913  
    914 CREATE FUNCTION quote_nullable(timestamp with time zone) RETURNS text 
    915     AS $_$ 
    916 SELECT CASE WHEN $1 IS NULL THEN 'NULL' ELSE quote_literal($1) END; 
    917 $_$ 
    918     LANGUAGE sql; 
    919  
    920  
    921 ALTER FUNCTION otools.quote_nullable(timestamp with time zone) OWNER TO postgres; 
    922  
    923 -- 
    924 -- Name: summarize_table_growth(); Type: FUNCTION; Schema: otools; Owner: postgres 
    925 -- 
    926  
    927 CREATE FUNCTION summarize_table_growth() RETURNS void 
    928     AS $$ 
    929 declare 
    930     v_sql text; 
    931 begin 
    932  
    933 -- Daily summarization 
    934 IF to_char(current_date,'dd') <> '01' THEN 
    935     insert into otools.table_growth (table_owner, schema_name, table_name, actual_size, growth_size, sum_flag, capture_time) 
    936     select a.table_owner, a.schema_name, a.table_name, a.actual_size, a.actual_size-coalesce(b.actual_size,0) AS table_growth, 1, a.capture_time 
    937     from otools.table_growth a  
    938         left join otools.table_growth b  
    939             on (a.table_owner=b.table_owner and a.table_name=b.table_name and a.schema_name=b.schema_name and b.capture_time = current_date -1)  
    940     where  
    941         a.sum_flag=0 and a.capture_time = current_date; 
    942     -- now remove older rows 
    943     delete from otools.table_growth where sum_flag = 0; 
    944 END IF; 
    945  
    946 -- Monthly summarization 
    947 IF to_char(current_date,'dd') = '01' THEN 
    948     insert into otools.table_growth (table_owner, schema_name, table_name, actual_size, growth_size, sum_flag, capture_time) 
    949     select a.table_owner, a.schema_name, a.table_name, max(actual_size), sum(growth_size), 2, (current_date - '1 month'::interval)  
    950     from otools.table_growth a  
    951     where sum_flag=1 and capture_time between (current_date - '1 month'::interval) and current_date  
    952     group by table_owner, schema_name, table_name; 
    953     -- now remove older rows 
    954     delete from otools.table_growth where sum_flag = 1; 
    955 END IF; 
    956  
    957 end  
    958 $$ 
    959     LANGUAGE plpgsql; 
    960  
    961  
    962 ALTER FUNCTION otools.summarize_table_growth() OWNER TO postgres; 
     480-- 
     481-- Name: tasklocks; Type: TABLE; Schema: stratcon; Owner: reconnoiter; Tablespace:  
     482-- 
     483 
     484CREATE TABLE tasklocks ( 
     485    id integer NOT NULL, 
     486    name text NOT NULL 
     487); 
     488 
     489 
     490ALTER TABLE stratcon.tasklocks OWNER TO reconnoiter; 
    963491 
    964492SET search_path = prism, pg_catalog; 
     
    1249777 
    1250778ALTER FUNCTION prism.trig_update_tsvector_saved_graphs() OWNER TO reconnoiter; 
    1251  
    1252 SET search_path = public, pg_catalog; 
    1253  
    1254 -- 
    1255 -- Name: date_hour(timestamp with time zone); Type: FUNCTION; Schema: public; Owner: reconnoiter 
    1256 -- 
    1257  
    1258 CREATE FUNCTION date_hour(timestamp with time zone) RETURNS timestamp with time zone 
    1259     AS $_$ 
    1260  SELECT date_trunc('hour',$1); 
    1261 $_$ 
    1262     LANGUAGE sql IMMUTABLE STRICT; 
    1263  
    1264  
    1265 ALTER FUNCTION public.date_hour(timestamp with time zone) OWNER TO reconnoiter; 
    1266779 
    1267780SET search_path = stratcon, pg_catalog; 
     
    18841397IF TG_OP = 'INSERT' THEN 
    18851398 
    1886              SELECT value FROM  stratcon.loading_dock_metric_text_s WHERE sid = NEW.sid AND name = NEW.name 
     1399             SELECT value FROM  stratcon.loading_dock_metric_text_s_change_log WHERE sid = NEW.sid AND name = NEW.name 
    18871400                 AND WHENCE = (SELECT max(whence) FROM stratcon.loading_dock_metric_text_s_change_log 
    18881401                                 WHERE WHENCE <> NEW.WHENCE and sid=NEW.sid and name=NEW.name ) 
     
    19281441    v_state CHAR(1); 
    19291442    v_avail CHAR(1); 
     1443    v_whence timestamp with time zone; 
    19301444BEGIN 
    19311445 
    19321446IF TG_OP = 'INSERT' THEN 
    1933     SELECT state,availability FROM  stratcon.loading_dock_status_s WHERE sid = NEW.sid  
    1934         AND WHENCE = (SELECT max(whence) FROM stratcon.loading_dock_status_s_change_log  
     1447    SELECT state,availability,whence FROM  stratcon.loading_dock_status_s_change_log WHERE sid = NEW.sid 
     1448        AND WHENCE = (SELECT max(whence) FROM stratcon.loading_dock_status_s_change_log 
    19351449                        WHERE  SID=NEW.sid and  WHENCE <> NEW.whence ) 
    1936     INTO v_state,v_avail; 
    1937  
    1938     IF v_state IS DISTINCT FROM NEW.state OR v_avail IS DISTINCT FROM NEW.availability THEN 
     1450    INTO v_state,v_avail,v_whence; 
     1451 
     1452    IF NEW.whence > v_whence AND  
     1453       (v_state IS DISTINCT FROM NEW.state OR v_avail IS DISTINCT FROM NEW.availability) THEN 
    19391454 
    19401455        INSERT INTO stratcon.loading_dock_status_s_change_log (sid,whence,state,availability,duration,status) 
    1941             VALUES (NEW.sid,NEW.whence,NEW.state,NEW.availability,NEW.duration,NEW.status);  
     1456            VALUES (NEW.sid,NEW.whence,NEW.state,NEW.availability,NEW.duration,NEW.status); 
    19421457 
    19431458    END IF; 
     
    22141729  v_whence TIMESTAMPTZ; 
    22151730  v_nrunning INT; 
    2216   v_self VARCHAR(22); 
     1731  v_taskid int; 
     1732  v_locked boolean; 
    22171733  whenceint RECORD;  
    22181734  
    22191735BEGIN 
    22201736 
    2221   SELECT COUNT(1) INTO v_nrunning 
    2222     from stratcon.rollup_runner t, pg_stat_activity a 
    2223     where rollup_table ='rollup_matrix_numeric_12hours' 
    2224      and runner = procpid || '.' || date_part('epoch',backend_start); 
    2225  
    2226   IF v_nrunning > 0 THEN 
    2227     RAISE NOTICE 'stratcon.rollup_matrix_numeric_12hours already running'; 
     1737  SELECT id into v_taskid from stratcon.tasklocks where name = 'rollup_matrix_numeric_12h'; 
     1738  IF v_taskid IS NULL THEN 
     1739    INSERT INTO stratcon.tasklocks (id, name) VALUES (DEFAULT, 'rollup_matrix_numeric_12h') 
     1740      RETURNING id into v_taskid; 
     1741  END IF; 
     1742 
     1743  select pg_try_advisory_lock(43191, v_taskid) into v_locked; 
     1744 
     1745  IF v_locked = false THEN 
     1746    RAISE NOTICE 'stratcon.rollup_matrix_numeric_12h already running'; 
    22281747    RETURN ; 
    22291748  END IF; 
    2230  
    2231   SELECT INTO v_self procpid || '.' || date_part('epoch',backend_start) 
    2232     FROM pg_stat_activity 
    2233      WHERE procpid = pg_backend_pid(); 
    2234  
    2235   IF v_self IS NULL THEN 
    2236     RAISE EXCEPTION 'stratcon.rollup_matrix_numeric_12hours cannot self-identify'; 
    2237    END IF; 
    2238  
    2239    v_sql = 'update stratcon.rollup_runner set runner = ''' || v_self || ''' where rollup_table = ''rollup_matrix_numeric_12hours'''; 
    2240  
    2241   EXECUTE v_sql; 
    22421749 
    22431750 FOR whenceint IN  SELECT * FROM stratcon.log_whence_s WHERE interval='12 hours' LOOP 
     
    22881795END LOOP; 
    22891796 
    2290 UPDATE stratcon.rollup_runner SET RUNNER = '' WHERE ROLLUP_TABLE= 'rollup_matrix_numeric_12hours'
     1797perform pg_advisory_unlock(43191, v_taskid)
    22911798 
    22921799RETURN; 
    22931800EXCEPTION 
    22941801    WHEN RAISE_EXCEPTION THEN 
    2295       UPDATE stratcon.rollup_runner set runner = '' where rollup_table = 'rollup_matrix_numeric_12hours'
     1802      perform pg_advisory_unlock(43191, v_taskid)
    22961803      RAISE EXCEPTION '%', SQLERRM; 
    22971804    WHEN OTHERS THEN 
     1805      perform pg_advisory_unlock(43191, v_taskid); 
    22981806      RAISE NOTICE '%', SQLERRM; 
    22991807END 
     
    23181826 rows INT; 
    23191827 v_nrunning INT; 
    2320  v_self VARCHAR(22); 
    23211828 whenceint RECORD; 
     1829 v_taskid int; 
     1830 v_locked boolean; 
    23221831BEGIN 
    23231832 
    2324   SELECT COUNT(1) INTO v_nrunning 
    2325     from stratcon.rollup_runner t, pg_stat_activity a 
    2326    where rollup_table ='rollup_matrix_numeric_20m' 
    2327      and runner = procpid || '.' || date_part('epoch',backend_start); 
    2328  
    2329   IF v_nrunning > 0 THEN 
     1833  SELECT id into v_taskid from stratcon.tasklocks where name = 'rollup_matrix_numeric_20m'; 
     1834  IF v_taskid IS NULL THEN 
     1835    INSERT INTO stratcon.tasklocks (id, name) VALUES (DEFAULT, 'rollup_matrix_numeric_20m') 
     1836      RETURNING id into v_taskid; 
     1837  END IF; 
     1838 
     1839  select pg_try_advisory_lock(43191, v_taskid) into v_locked; 
     1840 
     1841  IF v_locked = false THEN 
    23301842    RAISE NOTICE 'stratcon.rollup_matrix_numeric_20m already running'; 
    23311843    RETURN ; 
    23321844  END IF; 
    2333  
    2334   SELECT INTO v_self procpid || '.' || date_part('epoch',backend_start) 
    2335     FROM pg_stat_activity 
    2336    WHERE procpid = pg_backend_pid(); 
    2337  
    2338   IF v_self IS NULL THEN 
    2339     RAISE EXCEPTION 'stratcon.rollup_matrix_numeric_20m cannot self-identify'; 
    2340   END IF; 
    2341  
    2342   v_sql = 'update stratcon.rollup_runner set runner = ''' || v_self || ''' where rollup_table = ''rollup_matrix_numeric_20m'''; 
    2343  
    2344   EXECUTE v_sql; 
    23451845 
    23461846FOR whenceint IN SELECT * FROM stratcon.log_whence_s WHERE interval='20 minutes' LOOP 
     
    23921892 
    23931893 END LOOP; 
    2394   
    2395   UPDATE stratcon.rollup_runner SET RUNNER = '' WHERE ROLLUP_TABLE= 'rollup_matrix_numeric_20m'
     1894 
     1895  perform pg_advisory_unlock(43191, v_taskid)
    23961896   
    23971897RETURN; 
     
    23991899EXCEPTION 
    24001900    WHEN RAISE_EXCEPTION THEN 
    2401        UPDATE stratcon.rollup_runner SET RUNNER = '' WHERE ROLLUP_TABLE= 'rollup_matrix_numeric_20m'
     1901       perform pg_advisory_unlock(43191, v_taskid)
    24021902       RAISE EXCEPTION '%', SQLERRM; 
    24031903    WHEN OTHERS THEN 
    2404       RAISE NOTICE '%', SQLERRM; 
     1904       perform pg_advisory_unlock(43191, v_taskid); 
     1905        RAISE NOTICE '%', SQLERRM; 
    24051906END 
    24061907$$ 
     
    24241925 rows INT; 
    24251926 v_nrunning INT; 
    2426  v_self VARCHAR(22); 
     1927 v_taskid int; 
     1928 v_locked boolean; 
    24271929 whenceint RECORD; 
    24281930BEGIN 
    24291931 
    2430   SELECT COUNT(1) INTO v_nrunning 
    2431     from stratcon.rollup_runner t, pg_stat_activity a 
    2432    where rollup_table ='rollup_matrix_numeric_5m' 
    2433      and runner = procpid || '.' || date_part('epoch',backend_start); 
    2434  
    2435   IF v_nrunning > 0 THEN 
     1932  SELECT id into v_taskid from stratcon.tasklocks where name = 'rollup_matrix_numeric_5m'; 
     1933  IF v_taskid IS NULL THEN 
     1934    INSERT INTO stratcon.tasklocks (id, name) VALUES (DEFAULT, 'rollup_matrix_numeric_5m') 
     1935      RETURNING id into v_taskid; 
     1936  END IF; 
     1937 
     1938  select pg_try_advisory_lock(43191, v_taskid) into v_locked; 
     1939 
     1940  IF v_locked = false THEN 
    24361941    RAISE NOTICE 'stratcon.rollup_matrix_numeric_5m already running'; 
    24371942    RETURN ; 
    24381943  END IF; 
    24391944 
    2440   SELECT INTO v_self procpid || '.' || date_part('epoch',backend_start) 
    2441     FROM pg_stat_activity 
    2442    WHERE procpid = pg_backend_pid(); 
    2443  
    2444   IF v_self IS NULL THEN 
    2445     RAISE EXCEPTION 'stratcon.rollup_matrix_numeric_5m cannot self-identify'; 
    2446   END IF; 
    2447  
    2448   v_sql = 'update stratcon.rollup_runner set runner = ''' || v_self || ''' where rollup_table = ''rollup_matrix_numeric_5m'''; 
    2449  
    2450   EXECUTE v_sql; 
    2451  
    2452 FOR whenceint IN SELECT * FROM stratcon.log_whence_s WHERE interval='5 minutes' LOOP 
     1945  FOR whenceint IN SELECT * FROM stratcon.log_whence_s WHERE interval='5 minutes' LOOP 
    24531946         
    24541947 
     
    24841977  
    24851978 END LOOP; 
    2486   
    2487   UPDATE stratcon.rollup_runner SET RUNNER = '' WHERE ROLLUP_TABLE= 'rollup_matrix_numeric_5m'; 
     1979 
     1980 perform pg_advisory_unlock(43191, v_taskid);  
    24881981   
    24891982RETURN; 
     
    24911984EXCEPTION 
    24921985    WHEN RAISE_EXCEPTION THEN 
    2493        UPDATE stratcon.rollup_runner SET RUNNER = '' WHERE ROLLUP_TABLE= 'rollup_matrix_numeric_5m'; 
    2494        RAISE EXCEPTION '%', SQLERRM; 
     1986         perform pg_advisory_unlock(43191, v_taskid);  
     1987         RAISE EXCEPTION '%', SQLERRM; 
    24951988    WHEN OTHERS THEN 
     1989         perform pg_advisory_unlock(43191, v_taskid);  
    24961990         RAISE NOTICE '%', SQLERRM; 
    24971991END 
     
    25142008  v_whence TIMESTAMPTZ; 
    25152009  v_nrunning INT; 
    2516   v_self VARCHAR(22); 
     2010  v_taskid int; 
     2011  v_locked boolean; 
    25172012  whenceint RECORD; 
    25182013BEGIN 
    25192014 
    2520   SELECT COUNT(1) INTO v_nrunning 
    2521     from stratcon.rollup_runner t, pg_stat_activity a 
    2522    where rollup_table ='rollup_matrix_numeric_60m' 
    2523      and runner = procpid || '.' || date_part('epoch',backend_start); 
    2524  
    2525   IF v_nrunning > 0 THEN 
     2015  SELECT id into v_taskid from stratcon.tasklocks where name = 'rollup_matrix_numeric_60m'; 
     2016  IF v_taskid IS NULL THEN 
     2017    INSERT INTO stratcon.tasklocks (id, name) VALUES (DEFAULT, 'rollup_matrix_numeric_60m') 
     2018      RETURNING id into v_taskid; 
     2019  END IF; 
     2020 
     2021  select pg_try_advisory_lock(43191, v_taskid) into v_locked; 
     2022 
     2023  IF v_locked = false THEN 
    25262024    RAISE NOTICE 'stratcon.rollup_matrix_numeric_60m already running'; 
    25272025    RETURN ; 
    25282026  END IF; 
    25292027 
    2530   SELECT INTO v_self procpid || '.' || date_part('epoch',backend_start) 
    2531     FROM pg_stat_activity 
    2532    WHERE procpid = pg_backend_pid(); 
    2533  
    2534   IF v_self IS NULL THEN 
    2535     RAISE EXCEPTION 'stratcon.rollup_matrix_numeric_60m cannot self-identify'; 
    2536   END IF; 
    2537  
    2538   v_sql = 'update stratcon.rollup_runner set runner = ''' || v_self || ''' where rollup_table = ''rollup_matrix_numeric_60m'''; 
    2539  
    2540   EXECUTE v_sql; 
    25412028 
    25422029FOR whenceint IN SELECT * FROM stratcon.log_whence_s WHERE interval='1 hour' LOOP 
     
    25862073END LOOP; 
    25872074 
    2588 UPDATE stratcon.rollup_runner SET RUNNER = '' WHERE ROLLUP_TABLE= 'rollup_matrix_numeric_60m'; 
     2075    perform pg_advisory_unlock(43191, v_taskid);  
    25892076 
    25902077RETURN; 
     
    25922079EXCEPTION 
    25932080    WHEN RAISE_EXCEPTION THEN 
    2594        RAISE EXCEPTION '%', SQLERRM; 
     2081        perform pg_advisory_unlock(43191, v_taskid);  
     2082        RAISE EXCEPTION '%', SQLERRM; 
    25952083    WHEN OTHERS THEN 
    2596       RAISE NOTICE '%', SQLERRM; 
     2084        perform pg_advisory_unlock(43191, v_taskid);  
     2085        RAISE NOTICE '%', SQLERRM; 
    25972086END 
    25982087$$ 
     
    26142103  v_whence TIMESTAMPTZ; 
    26152104  v_nrunning INT; 
    2616   v_self VARCHAR(22); 
     2105  v_taskid int; 
     2106  v_locked boolean; 
    26172107  whenceint RECORD;   
    26182108BEGIN 
    26192109 
    2620   SELECT COUNT(1) INTO v_nrunning 
    2621     from stratcon.rollup_runner t, pg_stat_activity a 
    2622     where rollup_table ='rollup_matrix_numeric_6hours' 
    2623      and runner = procpid || '.' || date_part('epoch',backend_start); 
    2624  
    2625   IF v_nrunning > 0 THEN 
    2626     RAISE NOTICE 'stratcon.rollup_matrix_numeric_6hours already running'; 
     2110  SELECT id into v_taskid from stratcon.tasklocks where name = 'rollup_matrix_numeric_6h'; 
     2111  IF v_taskid IS NULL THEN 
     2112    INSERT INTO stratcon.tasklocks (id, name) VALUES (DEFAULT, 'rollup_matrix_numeric_6h') 
     2113      RETURNING id into v_taskid; 
     2114  END IF; 
     2115 
     2116  select pg_try_advisory_lock(43191, v_taskid) into v_locked; 
     2117 
     2118  IF v_locked = false THEN 
     2119    RAISE NOTICE 'stratcon.rollup_matrix_numeric_6h already running'; 
    26272120    RETURN ; 
    26282121  END IF; 
    2629  
    2630   SELECT INTO v_self procpid || '.' || date_part('epoch',backend_start) 
    2631     FROM pg_stat_activity 
    2632      WHERE procpid = pg_backend_pid(); 
    2633  
    2634   IF v_self IS NULL THEN 
    2635     RAISE EXCEPTION 'stratcon.rollup_matrix_numeric_6hours cannot self-identify'; 
    2636    END IF; 
    2637  
    2638    v_sql = 'update stratcon.rollup_runner set runner = ''' || v_self || ''' where rollup_table = ''rollup_matrix_numeric_6hours'''; 
    2639  
    2640   EXECUTE v_sql; 
    26412122 
    26422123FOR whenceint IN SELECT * FROM stratcon.log_whence_s WHERE interval='6 hours' LOOP 
     
    26862167END LOOP; 
    26872168 
    2688 UPDATE stratcon.rollup_runner SET RUNNER = '' WHERE ROLLUP_TABLE= 'rollup_matrix_numeric_6hours'; 
     2169perform pg_advisory_unlock(43191, v_taskid);  
    26892170 
    26902171RETURN; 
     
    26922173EXCEPTION 
    26932174    WHEN RAISE_EXCEPTION THEN 
     2175       perform pg_advisory_unlock(43191, v_taskid); 
    26942176       RAISE EXCEPTION '%', SQLERRM; 
    26952177    WHEN OTHERS THEN 
     2178       perform pg_advisory_unlock(43191, v_taskid);  
    26962179       RAISE NOTICE '%', SQLERRM; 
    26972180END 
     
    30362519ALTER TABLE stratcon.seq_sid OWNER TO reconnoiter; 
    30372520 
     2521-- 
     2522-- Name: tasklocks_id_seq; Type: SEQUENCE; Schema: stratcon; Owner: reconnoiter 
     2523-- 
     2524 
     2525CREATE SEQUENCE tasklocks_id_seq 
     2526    INCREMENT BY 1 
     2527    NO MAXVALUE 
     2528    NO MINVALUE 
     2529    CACHE 1; 
     2530 
     2531 
     2532ALTER TABLE stratcon.tasklocks_id_seq OWNER TO reconnoiter; 
     2533 
     2534-- 
     2535-- Name: tasklocks_id_seq; Type: SEQUENCE OWNED BY; Schema: stratcon; Owner: reconnoiter 
     2536-- 
     2537 
     2538ALTER SEQUENCE tasklocks_id_seq OWNED BY tasklocks.id; 
     2539 
     2540 
     2541-- 
     2542-- Name: id; Type: DEFAULT; Schema: stratcon; Owner: reconnoiter 
     2543-- 
     2544 
     2545ALTER TABLE tasklocks ALTER COLUMN id SET DEFAULT nextval('tasklocks_id_seq'::regclass); 
     2546 
     2547 
    30382548SET search_path = prism, pg_catalog; 
    30392549 
     
    30862596 
    30872597 
    3088 SET search_path = public, pg_catalog; 
    3089  
    3090 -- 
    3091 -- Name: pga_diagrams_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
    3092 -- 
    3093  
    3094 ALTER TABLE ONLY pga_diagrams 
    3095     ADD CONSTRAINT pga_diagrams_pkey PRIMARY KEY (diagramname); 
    3096  
    3097  
    3098 -- 
    3099 -- Name: pga_forms_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
    3100 -- 
    3101  
    3102 ALTER TABLE ONLY pga_forms 
    3103     ADD CONSTRAINT pga_forms_pkey PRIMARY KEY (formname); 
    3104  
    3105  
    3106 -- 
    3107 -- Name: pga_graphs_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
    3108 -- 
    3109  
    3110 ALTER TABLE ONLY pga_graphs 
    3111     ADD CONSTRAINT pga_graphs_pkey PRIMARY KEY (graphname); 
    3112  
    3113  
    3114 -- 
    3115 -- Name: pga_images_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
    3116 -- 
    3117  
    3118 ALTER TABLE ONLY pga_images 
    3119     ADD CONSTRAINT pga_images_pkey PRIMARY KEY (imagename); 
    3120  
    3121  
    3122 -- 
    3123 -- Name: pga_layout_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
    3124 -- 
    3125  
    3126 ALTER TABLE ONLY pga_layout 
    3127     ADD CONSTRAINT pga_layout_pkey PRIMARY KEY (tablename); 
    3128  
    3129  
    3130 -- 
    3131 -- Name: pga_queries_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
    3132 -- 
    3133  
    3134 ALTER TABLE ONLY pga_queries 
    3135     ADD CONSTRAINT pga_queries_pkey PRIMARY KEY (queryname); 
    3136  
    3137  
    3138 -- 
    3139 -- Name: pga_reports_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
    3140 -- 
    3141  
    3142 ALTER TABLE ONLY pga_reports 
    3143     ADD CONSTRAINT pga_reports_pkey PRIMARY KEY (reportname); 
    3144  
    3145  
    3146 -- 
    3147 -- Name: pga_scripts_pkey; Type: CONSTRAINT; Schema: public; Owner: reconnoiter; Tablespace:  
    3148 -- 
    3149  
    3150 ALTER TABLE ONLY pga_scripts 
    3151     ADD CONSTRAINT pga_scripts_pkey PRIMARY KEY (scriptname); 
    3152  
    3153  
    31542598SET search_path = stratcon, pg_catalog; 
    31552599 
     
    32452689 
    32462690-- 
     2691-- Name: loading_dock_status_archive_pkey; Type: CONSTRAINT; Schema: stratcon; Owner: reconnoiter; Tablespace:  
     2692-- 
     2693 
     2694ALTER TABLE ONLY loading_dock_status_archive 
     2695    ADD CONSTRAINT loading_dock_status_archive_pkey PRIMARY KEY (whence, sid); 
     2696 
     2697 
     2698-- 
    32472699-- Name: loading_dock_status_s_change_log_pkey; Type: CONSTRAINT; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    32482700-- 
     
    33502802 
    33512803 
     2804-- 
     2805-- Name: tasklocks_name_key; Type: CONSTRAINT; Schema: stratcon; Owner: reconnoiter; Tablespace:  
     2806-- 
     2807 
     2808ALTER TABLE ONLY tasklocks 
     2809    ADD CONSTRAINT tasklocks_name_key UNIQUE (name); 
     2810 
     2811 
     2812-- 
     2813-- Name: tasklocks_pkey; Type: CONSTRAINT; Schema: stratcon; Owner: reconnoiter; Tablespace:  
     2814-- 
     2815 
     2816ALTER TABLE ONLY tasklocks 
     2817    ADD CONSTRAINT tasklocks_pkey PRIMARY KEY (id); 
     2818 
     2819 
    33522820SET search_path = prism, pg_catalog; 
    33532821 
     
    34112879 
    34122880-- 
    3413 -- Name: loading_dock_metric_numeric_archive_200812_whence_key; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3414 -- 
    3415  
    3416 CREATE UNIQUE INDEX loading_dock_metric_numeric_archive_200812_whence_key ON loading_dock_metric_numeric_archive_200812 USING btree (whence, sid, name); 
    3417  
    3418  
    3419 -- 
    3420 -- Name: loading_dock_metric_numeric_archive_200901_whence_key; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3421 -- 
    3422  
    3423 CREATE UNIQUE INDEX loading_dock_metric_numeric_archive_200901_whence_key ON loading_dock_metric_numeric_archive_200901 USING btree (whence, sid, name); 
    3424  
    3425  
    3426 -- 
    3427 -- Name: loading_dock_metric_numeric_archive_200902_whence_key; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3428 -- 
    3429  
    3430 CREATE UNIQUE INDEX loading_dock_metric_numeric_archive_200902_whence_key ON loading_dock_metric_numeric_archive_200902 USING btree (whence, sid, name); 
    3431  
    3432  
    3433 -- 
    3434 -- Name: loading_dock_metric_numeric_archive_200903_whence_key; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3435 -- 
    3436  
    3437 CREATE UNIQUE INDEX loading_dock_metric_numeric_archive_200903_whence_key ON loading_dock_metric_numeric_archive_200903 USING btree (whence, sid, name); 
    3438  
    3439  
    3440 -- 
    3441 -- Name: loading_dock_metric_numeric_archive_200904_whence_key; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3442 -- 
    3443  
    3444 CREATE UNIQUE INDEX loading_dock_metric_numeric_archive_200904_whence_key ON loading_dock_metric_numeric_archive_200904 USING btree (whence, sid, name); 
    3445  
    3446  
    3447 -- 
    3448 -- Name: loading_dock_metric_numeric_archive_200905_whence_key; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3449 -- 
    3450  
    3451 CREATE UNIQUE INDEX loading_dock_metric_numeric_archive_200905_whence_key ON loading_dock_metric_numeric_archive_200905 USING btree (whence, sid, name); 
    3452  
    3453  
    3454 -- 
    3455 -- Name: loading_dock_metric_numeric_archive_200906_whence_key; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3456 -- 
    3457  
    3458 CREATE UNIQUE INDEX loading_dock_metric_numeric_archive_200906_whence_key ON loading_dock_metric_numeric_archive_200906 USING btree (whence, sid, name); 
    3459  
    3460  
    3461 -- 
    3462 -- Name: loading_dock_metric_numeric_archive_200907_whence_key; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3463 -- 
    3464  
    3465 CREATE UNIQUE INDEX loading_dock_metric_numeric_archive_200907_whence_key ON loading_dock_metric_numeric_archive_200907 USING btree (whence, sid, name); 
    3466  
    3467  
    3468 -- 
    3469 -- Name: loading_dock_metric_text_archive_200806_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3470 -- 
    3471  
    3472 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200806_pkey ON loading_dock_metric_text_archive_200806 USING btree (whence, sid, name); 
    3473  
    3474  
    3475 -- 
    3476 -- Name: loading_dock_metric_text_archive_200807_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3477 -- 
    3478  
    3479 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200807_pkey ON loading_dock_metric_text_archive_200807 USING btree (whence, sid, name); 
    3480  
    3481  
    3482 -- 
    3483 -- Name: loading_dock_metric_text_archive_200808_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3484 -- 
    3485  
    3486 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200808_pkey ON loading_dock_metric_text_archive_200808 USING btree (whence, sid, name); 
    3487  
    3488  
    3489 -- 
    3490 -- Name: loading_dock_metric_text_archive_200809_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3491 -- 
    3492  
    3493 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200809_pkey ON loading_dock_metric_text_archive_200809 USING btree (whence, sid, name); 
    3494  
    3495  
    3496 -- 
    3497 -- Name: loading_dock_metric_text_archive_200810_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3498 -- 
    3499  
    3500 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200810_pkey ON loading_dock_metric_text_archive_200810 USING btree (whence, sid, name); 
    3501  
    3502  
    3503 -- 
    3504 -- Name: loading_dock_metric_text_archive_200811_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3505 -- 
    3506  
    3507 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200811_pkey ON loading_dock_metric_text_archive_200811 USING btree (whence, sid, name); 
    3508  
    3509  
    3510 -- 
    3511 -- Name: loading_dock_metric_text_archive_200812_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3512 -- 
    3513  
    3514 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200812_pkey ON loading_dock_metric_text_archive_200812 USING btree (whence, sid, name); 
    3515  
    3516  
    3517 -- 
    3518 -- Name: loading_dock_metric_text_archive_200901_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3519 -- 
    3520  
    3521 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200901_pkey ON loading_dock_metric_text_archive_200901 USING btree (whence, sid, name); 
    3522  
    3523  
    3524 -- 
    3525 -- Name: loading_dock_metric_text_archive_200902_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3526 -- 
    3527  
    3528 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200902_pkey ON loading_dock_metric_text_archive_200902 USING btree (whence, sid, name); 
    3529  
    3530  
    3531 -- 
    3532 -- Name: loading_dock_metric_text_archive_200903_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3533 -- 
    3534  
    3535 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200903_pkey ON loading_dock_metric_text_archive_200903 USING btree (whence, sid, name); 
    3536  
    3537  
    3538 -- 
    3539 -- Name: loading_dock_metric_text_archive_200904_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3540 -- 
    3541  
    3542 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200904_pkey ON loading_dock_metric_text_archive_200904 USING btree (whence, sid, name); 
    3543  
    3544  
    3545 -- 
    3546 -- Name: loading_dock_metric_text_archive_200905_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3547 -- 
    3548  
    3549 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200905_pkey ON loading_dock_metric_text_archive_200905 USING btree (whence, sid, name); 
    3550  
    3551  
    3552 -- 
    3553 -- Name: loading_dock_metric_text_archive_200906_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3554 -- 
    3555  
    3556 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200906_pkey ON loading_dock_metric_text_archive_200906 USING btree (whence, sid, name); 
    3557  
    3558  
    3559 -- 
    3560 -- Name: loading_dock_metric_text_archive_200907_pkey; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3561 -- 
    3562  
    3563 CREATE UNIQUE INDEX loading_dock_metric_text_archive_200907_pkey ON loading_dock_metric_text_archive_200907 USING btree (whence, sid, name); 
    3564  
    3565  
    3566 -- 
    35672881-- Name: map_uuid_to_sid_idx; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    35682882-- 
    35692883 
    35702884CREATE UNIQUE INDEX map_uuid_to_sid_idx ON map_uuid_to_sid USING btree (sid); 
    3571  
    3572  
    3573 -- 
    3574 -- Name: sid_window; Type: INDEX; Schema: stratcon; Owner: reconnoiter; Tablespace:  
    3575 -- 
    3576  
    3577 CREATE INDEX sid_window ON loading_dock_metric_numeric_s USING btree (sid, whence); 
    35782885 
    35792886 
     
    36502957 
    36512958-- 
    3652 -- Name: loading_dock_metric_numeric_s_whence_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3653 -- 
    3654  
    3655 CREATE TRIGGER loading_dock_metric_numeric_s_whence_log 
    3656     AFTER INSERT ON loading_dock_metric_numeric_archive_200906 
    3657     FOR EACH ROW 
    3658     EXECUTE PROCEDURE loading_dock_metric_numeric_s_whence_log(); 
    3659  
    3660  
    3661 -- 
    3662 -- Name: loading_dock_metric_numeric_s_whence_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3663 -- 
    3664  
    3665 CREATE TRIGGER loading_dock_metric_numeric_s_whence_log 
    3666     AFTER INSERT ON loading_dock_metric_numeric_archive_200905 
    3667     FOR EACH ROW 
    3668     EXECUTE PROCEDURE loading_dock_metric_numeric_s_whence_log(); 
    3669  
    3670  
    3671 -- 
    3672 -- Name: loading_dock_metric_numeric_s_whence_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3673 -- 
    3674  
    3675 CREATE TRIGGER loading_dock_metric_numeric_s_whence_log 
    3676     AFTER INSERT ON loading_dock_metric_numeric_archive_200904 
    3677     FOR EACH ROW 
    3678     EXECUTE PROCEDURE loading_dock_metric_numeric_s_whence_log(); 
    3679  
    3680  
    3681 -- 
    3682 -- Name: loading_dock_metric_numeric_s_whence_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3683 -- 
    3684  
    3685 CREATE TRIGGER loading_dock_metric_numeric_s_whence_log 
    3686     AFTER INSERT ON loading_dock_metric_numeric_archive_200903 
    3687     FOR EACH ROW 
    3688     EXECUTE PROCEDURE loading_dock_metric_numeric_s_whence_log(); 
    3689  
    3690  
    3691 -- 
    3692 -- Name: loading_dock_metric_numeric_s_whence_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3693 -- 
    3694  
    3695 CREATE TRIGGER loading_dock_metric_numeric_s_whence_log 
    3696     AFTER INSERT ON loading_dock_metric_numeric_archive_200902 
    3697     FOR EACH ROW 
    3698     EXECUTE PROCEDURE loading_dock_metric_numeric_s_whence_log(); 
    3699  
    3700  
    3701 -- 
    3702 -- Name: loading_dock_metric_numeric_s_whence_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3703 -- 
    3704  
    3705 CREATE TRIGGER loading_dock_metric_numeric_s_whence_log 
    3706     AFTER INSERT ON loading_dock_metric_numeric_archive_200901 
    3707     FOR EACH ROW 
    3708     EXECUTE PROCEDURE loading_dock_metric_numeric_s_whence_log(); 
    3709  
    3710  
    3711 -- 
    3712 -- Name: loading_dock_metric_numeric_s_whence_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3713 -- 
    3714  
    3715 CREATE TRIGGER loading_dock_metric_numeric_s_whence_log 
    3716     AFTER INSERT ON loading_dock_metric_numeric_archive_200812 
    3717     FOR EACH ROW 
    3718     EXECUTE PROCEDURE loading_dock_metric_numeric_s_whence_log(); 
    3719  
    3720  
    3721 -- 
    3722 -- Name: loading_dock_metric_numeric_s_whence_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3723 -- 
    3724  
    3725 CREATE TRIGGER loading_dock_metric_numeric_s_whence_log 
    3726     AFTER INSERT ON loading_dock_metric_numeric_archive_200907 
    3727     FOR EACH ROW 
    3728     EXECUTE PROCEDURE loading_dock_metric_numeric_s_whence_log(); 
    3729  
    3730  
    3731 -- 
    37322959-- Name: loading_dock_metric_text_archive_empty; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    37332960-- 
     
    37602987 
    37612988-- 
    3762 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3763 -- 
    3764  
    3765 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3766     AFTER INSERT ON loading_dock_metric_text_archive_200806 
     2989-- Name: loading_dock_status_archive_empty; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
     2990-- 
     2991 
     2992CREATE TRIGGER loading_dock_status_archive_empty 
     2993    BEFORE INSERT OR UPDATE ON loading_dock_status_archive 
    37672994    FOR EACH ROW 
    3768     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3769  
    3770  
    3771 -- 
    3772 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3773 -- 
    3774  
    3775 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3776     AFTER INSERT ON loading_dock_metric_text_archive_200807 
    3777     FOR EACH ROW 
    3778     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3779  
    3780  
    3781 -- 
    3782 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3783 -- 
    3784  
    3785 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3786     AFTER INSERT ON loading_dock_metric_text_archive_200808 
    3787     FOR EACH ROW 
    3788     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3789  
    3790  
    3791 -- 
    3792 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3793 -- 
    3794  
    3795 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3796     AFTER INSERT ON loading_dock_metric_text_archive_200809 
    3797     FOR EACH ROW 
    3798     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3799  
    3800  
    3801 -- 
    3802 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3803 -- 
    3804  
    3805 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3806     AFTER INSERT ON loading_dock_metric_text_archive_200810 
    3807     FOR EACH ROW 
    3808     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3809  
    3810  
    3811 -- 
    3812 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3813 -- 
    3814  
    3815 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3816     AFTER INSERT ON loading_dock_metric_text_archive_200811 
    3817     FOR EACH ROW 
    3818     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3819  
    3820  
    3821 -- 
    3822 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3823 -- 
    3824  
    3825 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3826     AFTER INSERT ON loading_dock_metric_text_archive_200812 
    3827     FOR EACH ROW 
    3828     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3829  
    3830  
    3831 -- 
    3832 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3833 -- 
    3834  
    3835 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3836     AFTER INSERT ON loading_dock_metric_text_archive_200901 
    3837     FOR EACH ROW 
    3838     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3839  
    3840  
    3841 -- 
    3842 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3843 -- 
    3844  
    3845 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3846     AFTER INSERT ON loading_dock_metric_text_archive_200902 
    3847     FOR EACH ROW 
    3848     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3849  
    3850  
    3851 -- 
    3852 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3853 -- 
    3854  
    3855 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3856     AFTER INSERT ON loading_dock_metric_text_archive_200903 
    3857     FOR EACH ROW 
    3858     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3859  
    3860  
    3861 -- 
    3862 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3863 -- 
    3864  
    3865 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3866     AFTER INSERT ON loading_dock_metric_text_archive_200904 
    3867     FOR EACH ROW 
    3868     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3869  
    3870  
    3871 -- 
    3872 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3873 -- 
    3874  
    3875 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3876     AFTER INSERT ON loading_dock_metric_text_archive_200905 
    3877     FOR EACH ROW 
    3878     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3879  
    3880  
    3881 -- 
    3882 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3883 -- 
    3884  
    3885 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3886     AFTER INSERT ON loading_dock_metric_text_archive_200906 
    3887     FOR EACH ROW 
    3888     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
    3889  
    3890  
    3891 -- 
    3892 -- Name: loading_dock_metric_text_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    3893 -- 
    3894  
    3895 CREATE TRIGGER loading_dock_metric_text_s_change_log 
    3896     AFTER INSERT ON loading_dock_metric_text_archive_200907 
    3897     FOR EACH ROW 
    3898     EXECUTE PROCEDURE loading_dock_metric_text_s_change_log(); 
     2995    EXECUTE PROCEDURE parent_empty(); 
    38992996 
    39002997 
     
    39103007 
    39113008-- 
     3009-- Name: loading_dock_status_s_change_log; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
     3010-- 
     3011 
     3012CREATE TRIGGER loading_dock_status_s_change_log 
     3013    AFTER INSERT ON loading_dock_status_archive 
     3014    FOR EACH ROW 
     3015    EXECUTE PROCEDURE loading_dock_status_s_change_log(); 
     3016 
     3017 
     3018-- 
    39123019-- Name: mv_loading_dock_check_s; Type: TRIGGER; Schema: stratcon; Owner: reconnoiter 
    39133020-- 
     
    40193126GRANT ALL ON SCHEMA prism TO prism; 
    40203127GRANT ALL ON SCHEMA prism TO stratcon; 
    4021  
    4022  
    4023 -- 
    4024 -- Name: public; Type: ACL; Schema: -; Owner: postgres 
    4025 -- 
    4026  
    4027 REVOKE ALL ON SCHEMA public FROM PUBLIC; 
    4028 REVOKE ALL ON SCHEMA public FROM postgres; 
    4029 GRANT ALL ON SCHEMA public TO postgres; 
    4030 GRANT ALL ON SCHEMA public TO PUBLIC; 
    40313128 
    40323129 
     
    41623259 
    41633260-- 
    4164 -- Name: loading_dock_metric_numeric_archive_200812; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4165 -- 
    4166  
    4167 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200812 FROM PUBLIC; 
    4168 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200812 FROM reconnoiter; 
    4169 GRANT ALL ON TABLE loading_dock_metric_numeric_archive_200812 TO reconnoiter; 
    4170 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_numeric_archive_200812 TO stratcon; 
    4171 GRANT SELECT ON TABLE loading_dock_metric_numeric_archive_200812 TO prism; 
    4172  
    4173  
    4174 -- 
    4175 -- Name: loading_dock_metric_numeric_archive_200901; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4176 -- 
    4177  
    4178 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200901 FROM PUBLIC; 
    4179 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200901 FROM reconnoiter; 
    4180 GRANT ALL ON TABLE loading_dock_metric_numeric_archive_200901 TO reconnoiter; 
    4181 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_numeric_archive_200901 TO stratcon; 
    4182 GRANT SELECT ON TABLE loading_dock_metric_numeric_archive_200901 TO prism; 
    4183  
    4184  
    4185 -- 
    4186 -- Name: loading_dock_metric_numeric_archive_200902; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4187 -- 
    4188  
    4189 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200902 FROM PUBLIC; 
    4190 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200902 FROM reconnoiter; 
    4191 GRANT ALL ON TABLE loading_dock_metric_numeric_archive_200902 TO reconnoiter; 
    4192 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_numeric_archive_200902 TO stratcon; 
    4193 GRANT SELECT ON TABLE loading_dock_metric_numeric_archive_200902 TO prism; 
    4194  
    4195  
    4196 -- 
    4197 -- Name: loading_dock_metric_numeric_archive_200903; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4198 -- 
    4199  
    4200 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200903 FROM PUBLIC; 
    4201 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200903 FROM reconnoiter; 
    4202 GRANT ALL ON TABLE loading_dock_metric_numeric_archive_200903 TO reconnoiter; 
    4203 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_numeric_archive_200903 TO stratcon; 
    4204 GRANT SELECT ON TABLE loading_dock_metric_numeric_archive_200903 TO prism; 
    4205  
    4206  
    4207 -- 
    4208 -- Name: loading_dock_metric_numeric_archive_200904; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4209 -- 
    4210  
    4211 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200904 FROM PUBLIC; 
    4212 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200904 FROM reconnoiter; 
    4213 GRANT ALL ON TABLE loading_dock_metric_numeric_archive_200904 TO reconnoiter; 
    4214 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_numeric_archive_200904 TO stratcon; 
    4215 GRANT SELECT ON TABLE loading_dock_metric_numeric_archive_200904 TO prism; 
    4216  
    4217  
    4218 -- 
    4219 -- Name: loading_dock_metric_numeric_archive_200905; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4220 -- 
    4221  
    4222 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200905 FROM PUBLIC; 
    4223 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200905 FROM reconnoiter; 
    4224 GRANT ALL ON TABLE loading_dock_metric_numeric_archive_200905 TO reconnoiter; 
    4225 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_numeric_archive_200905 TO stratcon; 
    4226 GRANT SELECT ON TABLE loading_dock_metric_numeric_archive_200905 TO prism; 
    4227  
    4228  
    4229 -- 
    4230 -- Name: loading_dock_metric_numeric_archive_200906; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4231 -- 
    4232  
    4233 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200906 FROM PUBLIC; 
    4234 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200906 FROM reconnoiter; 
    4235 GRANT ALL ON TABLE loading_dock_metric_numeric_archive_200906 TO reconnoiter; 
    4236 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_numeric_archive_200906 TO stratcon; 
    4237 GRANT SELECT ON TABLE loading_dock_metric_numeric_archive_200906 TO prism; 
    4238  
    4239  
    4240 -- 
    4241 -- Name: loading_dock_metric_numeric_archive_200907; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4242 -- 
    4243  
    4244 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200907 FROM PUBLIC; 
    4245 REVOKE ALL ON TABLE loading_dock_metric_numeric_archive_200907 FROM reconnoiter; 
    4246 GRANT ALL ON TABLE loading_dock_metric_numeric_archive_200907 TO reconnoiter; 
    4247 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_numeric_archive_200907 TO stratcon; 
    4248 GRANT SELECT ON TABLE loading_dock_metric_numeric_archive_200907 TO prism; 
    4249  
    4250  
    4251 -- 
    42523261-- Name: loading_dock_metric_numeric_s; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    42533262-- 
     
    42833292 
    42843293-- 
    4285 -- Name: loading_dock_metric_text_archive_200806; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4286 -- 
    4287  
    4288 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200806 FROM PUBLIC; 
    4289 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200806 FROM reconnoiter; 
    4290 GRANT ALL ON TABLE loading_dock_metric_text_archive_200806 TO reconnoiter; 
    4291 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200806 TO stratcon; 
    4292 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200806 TO prism; 
    4293  
    4294  
    4295 -- 
    4296 -- Name: loading_dock_metric_text_archive_200807; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4297 -- 
    4298  
    4299 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200807 FROM PUBLIC; 
    4300 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200807 FROM reconnoiter; 
    4301 GRANT ALL ON TABLE loading_dock_metric_text_archive_200807 TO reconnoiter; 
    4302 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200807 TO stratcon; 
    4303 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200807 TO prism; 
    4304  
    4305  
    4306 -- 
    4307 -- Name: loading_dock_metric_text_archive_200808; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4308 -- 
    4309  
    4310 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200808 FROM PUBLIC; 
    4311 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200808 FROM reconnoiter; 
    4312 GRANT ALL ON TABLE loading_dock_metric_text_archive_200808 TO reconnoiter; 
    4313 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200808 TO stratcon; 
    4314 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200808 TO prism; 
    4315  
    4316  
    4317 -- 
    4318 -- Name: loading_dock_metric_text_archive_200809; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4319 -- 
    4320  
    4321 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200809 FROM PUBLIC; 
    4322 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200809 FROM reconnoiter; 
    4323 GRANT ALL ON TABLE loading_dock_metric_text_archive_200809 TO reconnoiter; 
    4324 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200809 TO stratcon; 
    4325 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200809 TO prism; 
    4326  
    4327  
    4328 -- 
    4329 -- Name: loading_dock_metric_text_archive_200810; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4330 -- 
    4331  
    4332 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200810 FROM PUBLIC; 
    4333 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200810 FROM reconnoiter; 
    4334 GRANT ALL ON TABLE loading_dock_metric_text_archive_200810 TO reconnoiter; 
    4335 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200810 TO stratcon; 
    4336 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200810 TO prism; 
    4337  
    4338  
    4339 -- 
    4340 -- Name: loading_dock_metric_text_archive_200811; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4341 -- 
    4342  
    4343 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200811 FROM PUBLIC; 
    4344 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200811 FROM reconnoiter; 
    4345 GRANT ALL ON TABLE loading_dock_metric_text_archive_200811 TO reconnoiter; 
    4346 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200811 TO stratcon; 
    4347 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200811 TO prism; 
    4348  
    4349  
    4350 -- 
    4351 -- Name: loading_dock_metric_text_archive_200812; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4352 -- 
    4353  
    4354 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200812 FROM PUBLIC; 
    4355 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200812 FROM reconnoiter; 
    4356 GRANT ALL ON TABLE loading_dock_metric_text_archive_200812 TO reconnoiter; 
    4357 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200812 TO stratcon; 
    4358 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200812 TO prism; 
    4359  
    4360  
    4361 -- 
    4362 -- Name: loading_dock_metric_text_archive_200901; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4363 -- 
    4364  
    4365 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200901 FROM PUBLIC; 
    4366 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200901 FROM reconnoiter; 
    4367 GRANT ALL ON TABLE loading_dock_metric_text_archive_200901 TO reconnoiter; 
    4368 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200901 TO stratcon; 
    4369 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200901 TO prism; 
    4370  
    4371  
    4372 -- 
    4373 -- Name: loading_dock_metric_text_archive_200902; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4374 -- 
    4375  
    4376 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200902 FROM PUBLIC; 
    4377 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200902 FROM reconnoiter; 
    4378 GRANT ALL ON TABLE loading_dock_metric_text_archive_200902 TO reconnoiter; 
    4379 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200902 TO stratcon; 
    4380 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200902 TO prism; 
    4381  
    4382  
    4383 -- 
    4384 -- Name: loading_dock_metric_text_archive_200903; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4385 -- 
    4386  
    4387 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200903 FROM PUBLIC; 
    4388 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200903 FROM reconnoiter; 
    4389 GRANT ALL ON TABLE loading_dock_metric_text_archive_200903 TO reconnoiter; 
    4390 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200903 TO stratcon; 
    4391 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200903 TO prism; 
    4392  
    4393  
    4394 -- 
    4395 -- Name: loading_dock_metric_text_archive_200904; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4396 -- 
    4397  
    4398 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200904 FROM PUBLIC; 
    4399 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200904 FROM reconnoiter; 
    4400 GRANT ALL ON TABLE loading_dock_metric_text_archive_200904 TO reconnoiter; 
    4401 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200904 TO stratcon; 
    4402 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200904 TO prism; 
    4403  
    4404  
    4405 -- 
    4406 -- Name: loading_dock_metric_text_archive_200905; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4407 -- 
    4408  
    4409 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200905 FROM PUBLIC; 
    4410 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200905 FROM reconnoiter; 
    4411 GRANT ALL ON TABLE loading_dock_metric_text_archive_200905 TO reconnoiter; 
    4412 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200905 TO stratcon; 
    4413 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200905 TO prism; 
    4414  
    4415  
    4416 -- 
    4417 -- Name: loading_dock_metric_text_archive_200906; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4418 -- 
    4419  
    4420 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200906 FROM PUBLIC; 
    4421 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200906 FROM reconnoiter; 
    4422 GRANT ALL ON TABLE loading_dock_metric_text_archive_200906 TO reconnoiter; 
    4423 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200906 TO stratcon; 
    4424 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200906 TO prism; 
    4425  
    4426  
    4427 -- 
    4428 -- Name: loading_dock_metric_text_archive_200907; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    4429 -- 
    4430  
    4431 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200907 FROM PUBLIC; 
    4432 REVOKE ALL ON TABLE loading_dock_metric_text_archive_200907 FROM reconnoiter; 
    4433 GRANT ALL ON TABLE loading_dock_metric_text_archive_200907 TO reconnoiter; 
    4434 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_metric_text_archive_200907 TO stratcon; 
    4435 GRANT SELECT ON TABLE loading_dock_metric_text_archive_200907 TO prism; 
    4436  
    4437  
    4438 -- 
    44393294-- Name: loading_dock_metric_text_s; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    44403295-- 
     
    44593314 
    44603315-- 
     3316-- Name: loading_dock_status_archive; Type: ACL; Schema: stratcon; Owner: reconnoiter 
     3317-- 
     3318 
     3319REVOKE ALL ON TABLE loading_dock_status_archive FROM PUBLIC; 
     3320REVOKE ALL ON TABLE loading_dock_status_archive FROM reconnoiter; 
     3321GRANT ALL ON TABLE loading_dock_status_archive TO reconnoiter; 
     3322GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE loading_dock_status_archive TO stratcon; 
     3323GRANT SELECT ON TABLE loading_dock_status_archive TO prism; 
     3324 
     3325 
     3326-- 
    44613327-- Name: loading_dock_status_s; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    44623328-- 
     
    46023468 
    46033469-- 
     3470-- Name: tasklocks; Type: ACL; Schema: stratcon; Owner: reconnoiter 
     3471-- 
     3472 
     3473REVOKE ALL ON TABLE tasklocks FROM PUBLIC; 
     3474REVOKE ALL ON TABLE tasklocks FROM reconnoiter; 
     3475GRANT ALL ON TABLE tasklocks TO reconnoiter; 
     3476GRANT SELECT,INSERT ON TABLE tasklocks TO stratcon; 
     3477 
     3478 
     3479-- 
    46043480-- Name: seq_sid; Type: ACL; Schema: stratcon; Owner: reconnoiter 
    46053481-- 
     
    46123488 
    46133489-- 
     3490-- Name: tasklocks_id_seq; Type: ACL; Schema: stratcon; Owner: reconnoiter 
     3491-- 
     3492 
     3493REVOKE ALL ON SEQUENCE tasklocks_id_seq FROM PUBLIC; 
     3494REVOKE ALL ON SEQUENCE tasklocks_id_seq FROM reconnoiter; 
     3495GRANT ALL ON SEQUENCE tasklocks_id_seq TO reconnoiter; 
     3496GRANT SELECT,UPDATE ON SEQUENCE tasklocks_id_seq TO stratcon; 
     3497 
     3498 
     3499-- 
    46143500-- PostgreSQL database dump complete 
    46153501-- 
  • src/stratcon.conf.in

    r2220278 rf6540ba  
    6565      ]]></check> 
    6666      <status><![CDATA[ 
    67         INSERT INTO stratcon.loading_dock_status_s 
     67        INSERT INTO stratcon.loading_dock_status_archive_%Y%m 
    6868                    ( whence,sid, state, availability, 
    6969                     duration, status) 
     
    7272      ]]></status> 
    7373      <metric_numeric><![CDATA[ 
    74         INSERT INTO stratcon.loading_dock_metric_numeric_s 
     74        INSERT INTO stratcon.loading_dock_metric_numeric_archive_%Y%m 
    7575                    (whence, sid, name, value) 
    7676             VALUES ( 'epoch'::timestamptz + ($1 || ' seconds')::interval, 
     
    7878      ]]></metric_numeric> 
    7979      <metric_text><![CDATA[ 
    80         INSERT INTO stratcon.loading_dock_metric_text_s 
     80        INSERT INTO stratcon.loading_dock_metric_text_archive_%Y%m 
    8181                    ( whence, sid, name,value) 
    8282             VALUES ('epoch'::timestamptz + ($1 || ' seconds')::interval, 
  • src/stratcon_datastore.c

    r264bd47 rf6540ba  
    4646#include <libpq-fe.h> 
    4747#include <zlib.h> 
     48#include <assert.h> 
    4849 
    4950static char *check_loadall = NULL; 
     
    248249} while(0) 
    249250 
     251#define PG_TM_EXEC(cmd, whence) do { \ 
     252  time_t __w = whence; \ 
     253  char cmdbuf[4096]; \ 
     254  struct tm tbuf, *tm; \ 
     255  tm = gmtime_r(&__w, &tbuf); \ 
     256  strftime(cmdbuf, sizeof(cmdbuf), cmd, tm); \ 
     257  d->res = PQexecParams(cq->dbh, cmdbuf, d->nparams, NULL, \ 
     258                        (const char * const *)d->paramValues, \ 
     259                        d->paramLengths, d->paramFormats, 0); \ 
     260  d->rv = PQresultStatus(d->res); \ 
     261  if(d->rv != PGRES_COMMAND_OK && \ 
     262     d->rv != PGRES_TUPLES_OK) { \ 
     263    noitL(noit_error, "stratcon datasource bad (%d): %s\n", \ 
     264          d->rv, PQresultErrorMessage(d->res)); \ 
     265    PQclear(d->res); \ 
     266    goto bad_row; \ 
     267  } \ 
     268} while(0) 
     269 
    250270static int 
    251271stratcon_datastore_asynch_drive_iep(eventer_t e, int mask, void *closure, 
     
    342362execute_outcome_t 
    343363stratcon_datastore_execute(conn_q *cq, struct sockaddr *r, ds_job_detail *d) { 
     364  time_t whence = 0; 
    344365  int type, len; 
    345366  char *final_buff; 
     
    395416        DECLARE_PARAM_STR("noitd",5); /* node_type */ 
    396417        PROCESS_NEXT_FIELD(token,len); 
     418        whence = (time_t)strtoul(token, NULL, 10); 
    397419        DECLARE_PARAM_STR(token,len); /* timestamp */ 
    398420 
     
    434456        PROCESS_NEXT_FIELD(token,len); 
    435457        DECLARE_PARAM_STR(token,len); /* timestamp */ 
     458        whence = (time_t)strtoul(token, NULL, 10); 
    436459        PROCESS_NEXT_FIELD(token, len); 
    437460        DECLARE_PARAM_STR(token,len); /* uuid */ 
     
    446469        PROCESS_NEXT_FIELD(token,len); 
    447470        DECLARE_PARAM_STR(token,len); /* timestamp */ 
     471        whence = (time_t)strtoul(token, NULL, 10); 
    448472        PROCESS_NEXT_FIELD(token, len); 
    449473        DECLARE_PARAM_STR(token,len); /* uuid */ 
     
    458482        PROCESS_NEXT_FIELD(token,len); 
    459483        DECLARE_PARAM_STR(token,len); /* timestamp */ 
     484        whence = (time_t)strtoul(token, NULL, 10); 
    460485        PROCESS_NEXT_FIELD(token, len); 
    461486        DECLARE_PARAM_STR(token,len); /* uuid */ 
     
    489514    case 'S': 
    490515      GET_QUERY(status_insert); 
    491       PG_EXEC(status_insert); 
     516      PG_TM_EXEC(status_insert, whence); 
    492517      PQclear(d->res); 
    493518      break; 
     
    500525        case METRIC_DOUBLE: 
    501526          GET_QUERY(metric_insert_numeric); 
    502           PG_EXEC(metric_insert_numeric); 
     527          PG_TM_EXEC(metric_insert_numeric, whence); 
    503528          PQclear(d->res); 
    504529          break; 
    505530        case METRIC_STRING: 
    506531          GET_QUERY(metric_insert_text); 
    507           PG_EXEC(metric_insert_text); 
     532          PG_TM_EXEC(metric_insert_text, whence); 
    508533          PQclear(d->res); 
    509534          break;