2 -- PostgreSQL database dump
5 SET client_encoding = 'SQL_ASCII';
6 SET check_function_bodies = false;
8 SET SESSION AUTHORIZATION 'pgbuildfarm';
10 SET search_path = public, pg_catalog;
13 -- TOC entry 21 (OID 46831)
14 -- Name: plpgsql_call_handler(); Type: FUNC PROCEDURAL LANGUAGE; Schema: public; Owner: pgbuildfarm
17 CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler
18 AS '$libdir/plpgsql', 'plpgsql_call_handler'
23 -- TOC entry 22 (OID 46833)
24 -- Name: plperl_call_handler(); Type: FUNC PROCEDURAL LANGUAGE; Schema: public; Owner: pgbuildfarm
27 CREATE FUNCTION plperl_call_handler() RETURNS language_handler
28 AS '$libdir/plperl', 'plperl_call_handler'
32 SET SESSION AUTHORIZATION DEFAULT;
35 -- TOC entry 16 (OID 46832)
36 -- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: public; Owner:
39 CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler;
43 -- TOC entry 17 (OID 46834)
44 -- Name: plperl; Type: PROCEDURAL LANGUAGE; Schema: public; Owner:
47 CREATE TRUSTED PROCEDURAL LANGUAGE plperl HANDLER plperl_call_handler;
51 -- TOC entry 18 (OID 46835)
52 -- Name: plperlu; Type: PROCEDURAL LANGUAGE; Schema: public; Owner:
55 CREATE PROCEDURAL LANGUAGE plperlu HANDLER plperl_call_handler;
58 SET SESSION AUTHORIZATION 'pgbuildfarm';
61 -- TOC entry 4 (OID 2200)
62 -- Name: public; Type: ACL; Schema: -; Owner: pgbuildfarm
65 REVOKE ALL ON SCHEMA public FROM PUBLIC;
66 GRANT ALL ON SCHEMA public TO PUBLIC;
69 SET SESSION AUTHORIZATION 'pgbuildfarm';
72 -- TOC entry 7 (OID 17150)
73 -- Name: buildsystems; Type: TABLE; Schema: public; Owner: pgbuildfarm
76 CREATE TABLE buildsystems (
79 operating_system text NOT NULL,
80 os_version text NOT NULL,
81 compiler text NOT NULL,
82 compiler_version text NOT NULL,
83 architecture text NOT NULL,
85 sys_owner text NOT NULL,
86 owner_email text NOT NULL,
87 status_ts timestamp without time zone DEFAULT (('now'::text)::timestamp(6) with time zone)::timestamp without time zone
92 -- TOC entry 8 (OID 17150)
93 -- Name: buildsystems; Type: ACL; Schema: public; Owner: pgbuildfarm
96 REVOKE ALL ON TABLE buildsystems FROM PUBLIC;
97 GRANT INSERT,SELECT ON TABLE buildsystems TO pgbfweb;
100 SET SESSION AUTHORIZATION 'pgbuildfarm';
103 -- TOC entry 9 (OID 17155)
104 -- Name: build_status; Type: TABLE; Schema: public; Owner: pgbuildfarm
107 CREATE TABLE build_status (
108 sysname text NOT NULL,
109 snapshot timestamp without time zone NOT NULL,
115 changed_this_run text,
116 changed_since_success text,
118 log_archive_filenames text[],
124 -- TOC entry 10 (OID 17155)
125 -- Name: build_status; Type: ACL; Schema: public; Owner: pgbuildfarm
128 REVOKE ALL ON TABLE build_status FROM PUBLIC;
129 GRANT INSERT,SELECT ON TABLE build_status TO pgbfweb;
132 SET SESSION AUTHORIZATION 'pgbuildfarm';
135 -- TOC entry 19 (OID 17160)
136 -- Name: approve(text, text); Type: FUNCTION; Schema: public; Owner: pgbuildfarm
139 CREATE FUNCTION approve(text, text) RETURNS void
140 AS 'update buildsystems set name = $2, status =''approved'' where name = $1 and status = ''pending'''
145 -- TOC entry 5 (OID 17162)
146 -- Name: pending; Type: TYPE; Schema: public; Owner: pgbuildfarm
149 CREATE TYPE pending AS (
151 operating_system text,
154 compiler_version text,
161 -- TOC entry 20 (OID 17164)
162 -- Name: approve2(text, text); Type: FUNCTION; Schema: public; Owner: pgbuildfarm
165 CREATE FUNCTION approve2(text, text) RETURNS text
166 AS ' update buildsystems set name = $2, status = ''approved'' where name = $1 and status = ''pending''; select owner_email || '':'' || name || '':'' || secret from buildsystems where name = $2;'
171 -- TOC entry 6 (OID 47855)
172 -- Name: pending2; Type: TYPE; Schema: public; Owner: pgbuildfarm
175 CREATE TYPE pending2 AS (
177 operating_system text,
180 compiler_version text,
184 status_ts timestamp without time zone
189 -- TOC entry 23 (OID 47857)
190 -- Name: pending(); Type: FUNCTION; Schema: public; Owner: pgbuildfarm
193 CREATE FUNCTION pending() RETURNS SETOF pending2
194 AS 'select name,operating_system,os_version,compiler,compiler_version,architecture,owner_email, sys_owner, status_ts from buildsystems where status = ''pending'' order by status_ts '
199 -- TOC entry 11 (OID 49741)
200 -- Name: list_subscriptions; Type: TABLE; Schema: public; Owner: pgbuildfarm
203 CREATE TABLE list_subscriptions (
209 -- TOC entry 24 (OID 55330)
210 -- Name: prevstat(text, text, timestamp without time zone); Type: FUNCTION; Schema: public; Owner: pgbuildfarm
213 CREATE FUNCTION prevstat(text, text, timestamp without time zone) RETURNS text
215 select coalesce((select distinct on (snapshot) stage
217 where sysname = $1 and branch = $2 and snapshot < $3
218 order by snapshot desc
219 limit 1), ''NEW'') as prev_status
225 -- TOC entry 13 (OID 23365)
226 -- Name: bs_branch_snapshot_idx; Type: INDEX; Schema: public; Owner: pgbuildfarm
229 CREATE INDEX bs_branch_snapshot_idx ON build_status USING btree (branch, snapshot);
233 -- TOC entry 14 (OID 23366)
234 -- Name: bs_sysname_branch_idx; Type: INDEX; Schema: public; Owner: pgbuildfarm
237 CREATE INDEX bs_sysname_branch_idx ON build_status USING btree (sysname, branch);
241 -- TOC entry 12 (OID 23367)
242 -- Name: buildsystems_pkey; Type: CONSTRAINT; Schema: public; Owner: pgbuildfarm
245 ALTER TABLE ONLY buildsystems
246 ADD CONSTRAINT buildsystems_pkey PRIMARY KEY (name);
250 -- TOC entry 15 (OID 23369)
251 -- Name: build_status_pkey; Type: CONSTRAINT; Schema: public; Owner: pgbuildfarm
254 ALTER TABLE ONLY build_status
255 ADD CONSTRAINT build_status_pkey PRIMARY KEY (sysname, snapshot);
259 -- TOC entry 25 (OID 23371)
260 -- Name: bs_fk; Type: FK CONSTRAINT; Schema: public; Owner: pgbuildfarm
263 ALTER TABLE ONLY build_status
264 ADD CONSTRAINT bs_fk FOREIGN KEY (sysname) REFERENCES buildsystems(name) ON UPDATE CASCADE ON DELETE CASCADE;
268 -- TOC entry 3 (OID 2200)
269 -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: pgbuildfarm
272 COMMENT ON SCHEMA public IS 'Standard public schema';