root/sql/tables/noit.metric_name_summary.sql

Revision b4c0bb19ecdfe7283237a73c2e71a43d343e4210, 1.7 kB (checked in by Robert Treat <robert@omniti.com>, 9 years ago)

trigger updates for metric name summary management, also some perms cleaning

  • Property mode set to 100644
Line 
1 -- formerly metric_name_summary (the same!)
2
3 --
4 -- PostgreSQL database dump
5 --
6
7 SET client_encoding = 'UTF8';
8 SET standard_conforming_strings = off;
9 SET check_function_bodies = false;
10 SET client_min_messages = warning;
11 SET escape_string_warning = off;
12
13 SET search_path = noit, pg_catalog;
14
15 SET default_tablespace = '';
16
17 SET default_with_oids = false;
18
19 --
20 -- Name: metric_name_summary; Type: TABLE; Schema: noit; Owner: reconnoiter; Tablespace:
21 --
22
23 CREATE TABLE metric_name_summary (
24     sid integer NOT NULL,
25     metric_name text NOT NULL,
26     metric_type text,
27     active boolean DEFAULT true,
28     fts_data tsvector
29 );
30
31
32 ALTER TABLE noit.metric_name_summary OWNER TO reconnoiter;
33
34 --
35 -- Name: metric_name_summary_pkey; Type: CONSTRAINT; Schema: noit; Owner: reconnoiter; Tablespace:
36 --
37
38 ALTER TABLE ONLY metric_name_summary
39     ADD CONSTRAINT metric_name_summary_pkey UNIQUE (sid, metric_name, metric_type);
40
41
42 --
43 -- Name: metric_name_summary_fts_data_idx; Type: INDEX; Schema: noit; Owner: reconnoiter; Tablespace:
44 --
45
46 CREATE INDEX metric_name_summary_fts_data_idx ON metric_name_summary USING gin (fts_data);
47
48
49 --
50 -- Name: trig_update_tsvector_from_metric_summary; Type: TRIGGER; Schema: noit; Owner: reconnoiter
51 --
52
53 CREATE TRIGGER update_metric_name_summary_fulltext
54     BEFORE INSERT OR UPDATE ON metric_name_summary
55     FOR EACH ROW
56     EXECUTE PROCEDURE update_mns_via_self();
57
58
59 --
60 -- Name: metric_name_summary; Type: ACL; Schema: noit; Owner: reconnoiter
61 --
62
63 REVOKE ALL ON TABLE metric_name_summary FROM PUBLIC;
64 GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE metric_name_summary TO stratcon;
65 GRANT SELECT,UPDATE ON TABLE metric_name_summary TO prism;
66
67
68 --
69 -- PostgreSQL database dump complete
70 --
71
Note: See TracBrowser for help on using the browser.