2
-- PostgreSQL database dump
5
-- Started on 2008-05-15 17:56:20 EDT
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;
13
SET search_path = public, pg_catalog;
15
SET default_tablespace = '';
17
SET default_with_oids = false;
20
-- TOC entry 1745 (class 1259 OID 17664)
22
-- Name: ppl_coaches; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
25
CREATE TABLE ppl_coaches (
26
personid integer NOT NULL,
27
schoolid integer NOT NULL
31
ALTER TABLE public.ppl_coaches OWNER TO codescore;
34
-- TOC entry 1746 (class 1259 OID 17667)
36
-- Name: ppl_comps; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
39
CREATE TABLE ppl_comps (
47
ALTER TABLE public.ppl_comps OWNER TO codescore;
50
-- TOC entry 1773 (class 1259 OID 17880)
52
-- Name: pk_ppl_email; Type: SEQUENCE; Schema: public; Owner: codescore
55
CREATE SEQUENCE pk_ppl_email
62
ALTER TABLE public.pk_ppl_email OWNER TO codescore;
65
-- TOC entry 1747 (class 1259 OID 17670)
66
-- Dependencies: 2114 6
67
-- Name: ppl_email; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
70
CREATE TABLE ppl_email (
71
emailid integer DEFAULT nextval('pk_ppl_email'::regclass) NOT NULL,
72
personid integer NOT NULL,
73
address character varying(255) NOT NULL
77
ALTER TABLE public.ppl_email OWNER TO codescore;
80
-- TOC entry 1748 (class 1259 OID 17673)
82
-- Name: ppl_judges; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
85
CREATE TABLE ppl_judges (
86
compid integer NOT NULL,
87
password character varying(255) NOT NULL,
88
personid integer NOT NULL
92
ALTER TABLE public.ppl_judges OWNER TO codescore;
95
-- TOC entry 1775 (class 1259 OID 17884)
97
-- Name: pk_ppl_list; Type: SEQUENCE; Schema: public; Owner: codescore
100
CREATE SEQUENCE pk_ppl_list
107
ALTER TABLE public.pk_ppl_list OWNER TO codescore;
110
-- TOC entry 1749 (class 1259 OID 17676)
111
-- Dependencies: 2115 6
112
-- Name: ppl_list; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
115
CREATE TABLE ppl_list (
116
hidden boolean NOT NULL,
117
inactive boolean NOT NULL,
118
name character varying(255) NOT NULL,
119
password character varying(255) NOT NULL,
120
personid integer DEFAULT nextval('pk_ppl_list'::regclass) NOT NULL
124
ALTER TABLE public.ppl_list OWNER TO codescore;
127
-- TOC entry 1776 (class 1259 OID 17886)
129
-- Name: pk_ppl_region; Type: SEQUENCE; Schema: public; Owner: codescore
132
CREATE SEQUENCE pk_ppl_region
140
ALTER TABLE public.pk_ppl_region OWNER TO codescore;
143
-- TOC entry 1750 (class 1259 OID 17682)
144
-- Dependencies: 2116 6
145
-- Name: ppl_region; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
148
CREATE TABLE ppl_region (
149
regionid integer DEFAULT nextval('pk_ppl_region'::regclass) NOT NULL,
150
"Name" character varying(255) NOT NULL
154
ALTER TABLE public.ppl_region OWNER TO postgres;
157
-- TOC entry 1751 (class 1259 OID 17685)
158
-- Dependencies: 1921 6
159
-- Name: ppl_roles; Type: VIEW; Schema: public; Owner: codescore
162
CREATE VIEW ppl_roles AS
163
((SELECT ppl_list.name, 'Person' AS role FROM ppl_list UNION SELECT ppl_list.name, 'Admin' AS role FROM ppl_list WHERE (ppl_list.hidden = true)) UNION SELECT ppl_list.name, 'Coach' AS role FROM (ppl_list RIGHT JOIN ppl_coaches ON ((ppl_list.personid = ppl_coaches.personid)))) UNION SELECT ppl_list.name, 'Judge' AS role FROM (ppl_list RIGHT JOIN ppl_judges ON ((ppl_list.personid = ppl_judges.personid)));
166
ALTER TABLE public.ppl_roles OWNER TO codescore;
169
-- TOC entry 1777 (class 1259 OID 17888)
171
-- Name: pk_ppl_schools; Type: SEQUENCE; Schema: public; Owner: codescore
174
CREATE SEQUENCE pk_ppl_schools
182
ALTER TABLE public.pk_ppl_schools OWNER TO codescore;
185
-- TOC entry 1752 (class 1259 OID 17689)
186
-- Dependencies: 2117 6
187
-- Name: ppl_schools; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
190
CREATE TABLE ppl_schools (
191
name character varying(255) NOT NULL,
192
schoolid integer DEFAULT nextval('pk_ppl_schools'::regclass) NOT NULL,
193
webpage character varying(255),
198
ALTER TABLE public.ppl_schools OWNER TO codescore;
201
-- TOC entry 1753 (class 1259 OID 17695)
203
-- Name: pk_prob_cases; Type: SEQUENCE; Schema: public; Owner: codescore
206
CREATE SEQUENCE pk_prob_cases
213
ALTER TABLE public.pk_prob_cases OWNER TO codescore;
216
-- TOC entry 1794 (class 1259 OID 18146)
217
-- Dependencies: 2139 2140 6
218
-- Name: prob_cases; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
221
CREATE TABLE prob_cases (
222
active boolean DEFAULT true NOT NULL,
223
caseid integer DEFAULT nextval('pk_prob_cases'::regclass) NOT NULL,
225
output text NOT NULL,
226
probid integer NOT NULL
230
ALTER TABLE public.prob_cases OWNER TO codescore;
233
-- TOC entry 1778 (class 1259 OID 17890)
235
-- Name: pk_prob_comments; Type: SEQUENCE; Schema: public; Owner: codescore
238
CREATE SEQUENCE pk_prob_comments
246
ALTER TABLE public.pk_prob_comments OWNER TO codescore;
249
-- TOC entry 1754 (class 1259 OID 17705)
250
-- Dependencies: 2118 2119 6
251
-- Name: prob_comments; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
254
CREATE TABLE prob_comments (
255
comid integer DEFAULT nextval('pk_prob_comments'::regclass) NOT NULL,
256
message text NOT NULL,
257
personid integer NOT NULL,
258
probid integer NOT NULL,
259
tstamp timestamp with time zone DEFAULT now() NOT NULL
263
ALTER TABLE public.prob_comments OWNER TO codescore;
266
-- TOC entry 1779 (class 1259 OID 17892)
268
-- Name: pk_prob_descfigs; Type: SEQUENCE; Schema: public; Owner: codescore
271
CREATE SEQUENCE pk_prob_descfigs
279
ALTER TABLE public.pk_prob_descfigs OWNER TO codescore;
282
-- TOC entry 1755 (class 1259 OID 17712)
283
-- Dependencies: 2120 6
284
-- Name: prob_descfigs; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
287
CREATE TABLE prob_descfigs (
288
figid integer DEFAULT nextval('pk_prob_descfigs'::regclass) NOT NULL,
289
figure bytea NOT NULL,
290
name character varying(100),
291
probid integer NOT NULL
295
ALTER TABLE public.prob_descfigs OWNER TO codescore;
298
-- TOC entry 1780 (class 1259 OID 17894)
300
-- Name: pk_prob_list; Type: SEQUENCE; Schema: public; Owner: codescore
303
CREATE SEQUENCE pk_prob_list
310
ALTER TABLE public.pk_prob_list OWNER TO codescore;
313
-- TOC entry 1756 (class 1259 OID 17718)
314
-- Dependencies: 2121 2122 2123 6
315
-- Name: prob_list; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
318
CREATE TABLE prob_list (
319
active boolean DEFAULT true NOT NULL,
321
difficulty smallint DEFAULT 128 NOT NULL,
322
name character varying(255) NOT NULL,
323
problemid integer DEFAULT nextval('pk_prob_list'::regclass) NOT NULL,
326
unixname character varying(128) NOT NULL,
327
parsed_document tsvector,
332
ALTER TABLE public.prob_list OWNER TO codescore;
335
-- TOC entry 1757 (class 1259 OID 17726)
337
-- Name: prob_set; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
340
CREATE TABLE prob_set (
341
compid integer NOT NULL,
342
probid integer NOT NULL
346
ALTER TABLE public.prob_set OWNER TO codescore;
349
-- TOC entry 1782 (class 1259 OID 17898)
351
-- Name: pk_prob_solutions; Type: SEQUENCE; Schema: public; Owner: codescore
354
CREATE SEQUENCE pk_prob_solutions
362
ALTER TABLE public.pk_prob_solutions OWNER TO codescore;
365
-- TOC entry 1758 (class 1259 OID 17729)
366
-- Dependencies: 2124 6
367
-- Name: prob_solutions; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
370
CREATE TABLE prob_solutions (
375
langid integer NOT NULL,
376
pid integer NOT NULL,
377
sid integer DEFAULT nextval('pk_prob_solutions'::regclass) NOT NULL,
381
"time" timestamp with time zone
385
ALTER TABLE public.prob_solutions OWNER TO codescore;
388
-- TOC entry 1783 (class 1259 OID 17900)
390
-- Name: pk_prob_status; Type: SEQUENCE; Schema: public; Owner: codescore
393
CREATE SEQUENCE pk_prob_status
401
ALTER TABLE public.pk_prob_status OWNER TO codescore;
404
-- TOC entry 1759 (class 1259 OID 17735)
405
-- Dependencies: 2125 6
406
-- Name: prob_status; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
409
CREATE TABLE prob_status (
410
name character varying(255),
411
statid integer DEFAULT nextval('pk_prob_status'::regclass) NOT NULL
415
ALTER TABLE public.prob_status OWNER TO codescore;
418
-- TOC entry 1760 (class 1259 OID 17738)
419
-- Dependencies: 2126 6
420
-- Name: prob_tag_list; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
423
CREATE TABLE prob_tag_list (
424
name character varying(100) NOT NULL,
425
tagid integer DEFAULT nextval('prob_tag_list'::regclass) NOT NULL
429
ALTER TABLE public.prob_tag_list OWNER TO codescore;
432
-- TOC entry 1761 (class 1259 OID 17741)
434
-- Name: prob_tags; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
437
CREATE TABLE prob_tags (
438
probid integer NOT NULL,
439
tagid integer NOT NULL
443
ALTER TABLE public.prob_tags OWNER TO codescore;
446
-- TOC entry 415 (class 1247 OID 17746)
447
-- Dependencies: 6 1762
448
-- Name: prob_ts_result; Type: TYPE; Schema: public; Owner: postgres
451
CREATE TYPE prob_ts_result AS (
459
ALTER TYPE public.prob_ts_result OWNER TO postgres;
462
-- TOC entry 1845 (class 1259 OID 18729)
464
-- Name: pk_prob_versions; Type: SEQUENCE; Schema: public; Owner: postgres
467
CREATE SEQUENCE pk_prob_versions
475
ALTER TABLE public.pk_prob_versions OWNER TO postgres;
478
-- TOC entry 1763 (class 1259 OID 17747)
479
-- Dependencies: 2127 2128 6
480
-- Name: prob_versions; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
483
CREATE TABLE prob_versions (
484
versionid integer DEFAULT nextval('pk_prob_versions'::regclass) NOT NULL,
485
problemid integer NOT NULL,
489
unixname character varying(128) NOT NULL,
490
tstamp timestamp with time zone DEFAULT now(),
491
personid integer NOT NULL
495
ALTER TABLE public.prob_versions OWNER TO postgres;
498
-- TOC entry 1786 (class 1259 OID 17906)
500
-- Name: pk_sys_clari; Type: SEQUENCE; Schema: public; Owner: codescore
503
CREATE SEQUENCE pk_sys_clari
510
ALTER TABLE public.pk_sys_clari OWNER TO codescore;
513
-- TOC entry 1764 (class 1259 OID 17754)
514
-- Dependencies: 2129 6
515
-- Name: sys_clari; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
518
CREATE TABLE sys_clari (
519
cid integer DEFAULT nextval('pk_sys_clari'::regclass) NOT NULL,
520
compid integer NOT NULL,
526
ALTER TABLE public.sys_clari OWNER TO codescore;
529
-- TOC entry 1787 (class 1259 OID 17908)
531
-- Name: pk_sys_compargs; Type: SEQUENCE; Schema: public; Owner: codescore
534
CREATE SEQUENCE pk_sys_compargs
542
ALTER TABLE public.pk_sys_compargs OWNER TO codescore;
545
-- TOC entry 1765 (class 1259 OID 17760)
546
-- Dependencies: 2130 6
547
-- Name: sys_compargs; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
550
CREATE TABLE sys_compargs (
551
argid integer DEFAULT nextval('pk_sys_compargs'::regclass) NOT NULL,
552
langid integer NOT NULL,
553
"position" integer NOT NULL,
554
val character varying(255) NOT NULL
558
ALTER TABLE public.sys_compargs OWNER TO codescore;
561
-- TOC entry 1788 (class 1259 OID 17910)
563
-- Name: pk_sys_comps; Type: SEQUENCE; Schema: public; Owner: codescore
566
CREATE SEQUENCE pk_sys_comps
573
ALTER TABLE public.pk_sys_comps OWNER TO codescore;
576
-- TOC entry 1766 (class 1259 OID 17763)
577
-- Dependencies: 2131 6
578
-- Name: sys_comps; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
581
CREATE TABLE sys_comps (
582
active boolean NOT NULL,
583
compid integer DEFAULT nextval('pk_sys_comps'::regclass) NOT NULL,
584
endtime timestamp with time zone NOT NULL,
585
name character varying(255) NOT NULL,
587
starttime timestamp with time zone NOT NULL
591
ALTER TABLE public.sys_comps OWNER TO codescore;
594
-- TOC entry 1789 (class 1259 OID 17912)
596
-- Name: pk_sys_exeargs; Type: SEQUENCE; Schema: public; Owner: codescore
599
CREATE SEQUENCE pk_sys_exeargs
607
ALTER TABLE public.pk_sys_exeargs OWNER TO codescore;
610
-- TOC entry 1767 (class 1259 OID 17769)
611
-- Dependencies: 2132 6
612
-- Name: sys_exeargs; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
615
CREATE TABLE sys_exeargs (
616
argid integer DEFAULT nextval('pk_sys_exeargs'::regclass) NOT NULL,
617
langid integer NOT NULL,
618
"position" integer NOT NULL,
619
val character varying(255) NOT NULL
623
ALTER TABLE public.sys_exeargs OWNER TO codescore;
626
-- TOC entry 1790 (class 1259 OID 17914)
628
-- Name: pk_sys_langs; Type: SEQUENCE; Schema: public; Owner: codescore
631
CREATE SEQUENCE pk_sys_langs
639
ALTER TABLE public.pk_sys_langs OWNER TO codescore;
642
-- TOC entry 1768 (class 1259 OID 17772)
643
-- Dependencies: 2133 6
644
-- Name: sys_langs; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
647
CREATE TABLE sys_langs (
648
fileextention character varying(16) NOT NULL,
649
lid integer DEFAULT nextval('pk_sys_langs'::regclass) NOT NULL,
650
name character varying(255) NOT NULL
654
ALTER TABLE public.sys_langs OWNER TO codescore;
657
-- TOC entry 1791 (class 1259 OID 17916)
659
-- Name: pk_team_list; Type: SEQUENCE; Schema: public; Owner: codescore
662
CREATE SEQUENCE pk_team_list
669
ALTER TABLE public.pk_team_list OWNER TO codescore;
672
-- TOC entry 1769 (class 1259 OID 17775)
673
-- Dependencies: 2134 6
674
-- Name: team_list; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
677
CREATE TABLE team_list (
678
name character varying(255) NOT NULL,
679
schoolid integer NOT NULL,
680
teamid integer DEFAULT nextval('pk_team_list'::regclass) NOT NULL
684
ALTER TABLE public.team_list OWNER TO codescore;
687
-- TOC entry 1793 (class 1259 OID 17920)
689
-- Name: pk_team_subs; Type: SEQUENCE; Schema: public; Owner: codescore
692
CREATE SEQUENCE pk_team_subs
699
ALTER TABLE public.pk_team_subs OWNER TO codescore;
702
-- TOC entry 1770 (class 1259 OID 17778)
703
-- Dependencies: 2135 2136 2137 2138 6
704
-- Name: team_subs; Type: TABLE; Schema: public; Owner: codescore; Tablespace:
707
CREATE TABLE team_subs (
712
langid integer NOT NULL,
713
pid integer NOT NULL,
714
points integer DEFAULT 0 NOT NULL,
718
subid integer DEFAULT nextval('pk_team_subs'::regclass) NOT NULL,
719
tid integer NOT NULL,
720
"time" timestamp with time zone DEFAULT now(),
721
CONSTRAINT non_neg_points CHECK ((points >= 0))
725
ALTER TABLE public.team_subs OWNER TO codescore;
728
-- TOC entry 2239 (class 0 OID 0)
729
-- Dependencies: 1770
730
-- Name: CONSTRAINT non_neg_points ON team_subs; Type: COMMENT; Schema: public; Owner: codescore
733
COMMENT ON CONSTRAINT non_neg_points ON team_subs IS 'the points column cannot be negitive';
737
-- TOC entry 21 (class 1255 OID 17787)
739
-- Name: armor(bytea); Type: FUNCTION; Schema: public; Owner: postgres
742
CREATE FUNCTION armor(bytea) RETURNS text
743
AS '$libdir/pgcrypto', 'pg_armor'
744
LANGUAGE c IMMUTABLE STRICT;
747
ALTER FUNCTION public.armor(bytea) OWNER TO postgres;
750
-- TOC entry 22 (class 1255 OID 17788)
752
-- Name: crypt(text, text); Type: FUNCTION; Schema: public; Owner: postgres
755
CREATE FUNCTION crypt(text, text) RETURNS text
756
AS '$libdir/pgcrypto', 'pg_crypt'
757
LANGUAGE c IMMUTABLE STRICT;
760
ALTER FUNCTION public.crypt(text, text) OWNER TO postgres;
763
-- TOC entry 23 (class 1255 OID 17789)
765
-- Name: dearmor(text); Type: FUNCTION; Schema: public; Owner: postgres
768
CREATE FUNCTION dearmor(text) RETURNS bytea
769
AS '$libdir/pgcrypto', 'pg_dearmor'
770
LANGUAGE c IMMUTABLE STRICT;
773
ALTER FUNCTION public.dearmor(text) OWNER TO postgres;
776
-- TOC entry 24 (class 1255 OID 17790)
778
-- Name: decrypt(bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
781
CREATE FUNCTION decrypt(bytea, bytea, text) RETURNS bytea
782
AS '$libdir/pgcrypto', 'pg_decrypt'
783
LANGUAGE c IMMUTABLE STRICT;
786
ALTER FUNCTION public.decrypt(bytea, bytea, text) OWNER TO postgres;
789
-- TOC entry 25 (class 1255 OID 17791)
791
-- Name: decrypt_iv(bytea, bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
794
CREATE FUNCTION decrypt_iv(bytea, bytea, bytea, text) RETURNS bytea
795
AS '$libdir/pgcrypto', 'pg_decrypt_iv'
796
LANGUAGE c IMMUTABLE STRICT;
799
ALTER FUNCTION public.decrypt_iv(bytea, bytea, bytea, text) OWNER TO postgres;
802
-- TOC entry 26 (class 1255 OID 17792)
804
-- Name: digest(text, text); Type: FUNCTION; Schema: public; Owner: postgres
807
CREATE FUNCTION digest(text, text) RETURNS bytea
808
AS '$libdir/pgcrypto', 'pg_digest'
809
LANGUAGE c IMMUTABLE STRICT;
812
ALTER FUNCTION public.digest(text, text) OWNER TO postgres;
815
-- TOC entry 27 (class 1255 OID 17793)
817
-- Name: digest(bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
820
CREATE FUNCTION digest(bytea, text) RETURNS bytea
821
AS '$libdir/pgcrypto', 'pg_digest'
822
LANGUAGE c IMMUTABLE STRICT;
825
ALTER FUNCTION public.digest(bytea, text) OWNER TO postgres;
828
-- TOC entry 28 (class 1255 OID 17794)
830
-- Name: encrypt(bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
833
CREATE FUNCTION encrypt(bytea, bytea, text) RETURNS bytea
834
AS '$libdir/pgcrypto', 'pg_encrypt'
835
LANGUAGE c IMMUTABLE STRICT;
838
ALTER FUNCTION public.encrypt(bytea, bytea, text) OWNER TO postgres;
841
-- TOC entry 29 (class 1255 OID 17795)
843
-- Name: encrypt_iv(bytea, bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
846
CREATE FUNCTION encrypt_iv(bytea, bytea, bytea, text) RETURNS bytea
847
AS '$libdir/pgcrypto', 'pg_encrypt_iv'
848
LANGUAGE c IMMUTABLE STRICT;
851
ALTER FUNCTION public.encrypt_iv(bytea, bytea, bytea, text) OWNER TO postgres;
854
-- TOC entry 30 (class 1255 OID 17796)
856
-- Name: gen_random_bytes(integer); Type: FUNCTION; Schema: public; Owner: postgres
859
CREATE FUNCTION gen_random_bytes(integer) RETURNS bytea
860
AS '$libdir/pgcrypto', 'pg_random_bytes'
864
ALTER FUNCTION public.gen_random_bytes(integer) OWNER TO postgres;
867
-- TOC entry 31 (class 1255 OID 17797)
869
-- Name: gen_salt(text); Type: FUNCTION; Schema: public; Owner: postgres
872
CREATE FUNCTION gen_salt(text) RETURNS text
873
AS '$libdir/pgcrypto', 'pg_gen_salt'
877
ALTER FUNCTION public.gen_salt(text) OWNER TO postgres;
880
-- TOC entry 32 (class 1255 OID 17798)
882
-- Name: gen_salt(text, integer); Type: FUNCTION; Schema: public; Owner: postgres
885
CREATE FUNCTION gen_salt(text, integer) RETURNS text
886
AS '$libdir/pgcrypto', 'pg_gen_salt_rounds'
890
ALTER FUNCTION public.gen_salt(text, integer) OWNER TO postgres;
893
-- TOC entry 33 (class 1255 OID 17799)
895
-- Name: hmac(text, text, text); Type: FUNCTION; Schema: public; Owner: postgres
898
CREATE FUNCTION hmac(text, text, text) RETURNS bytea
899
AS '$libdir/pgcrypto', 'pg_hmac'
900
LANGUAGE c IMMUTABLE STRICT;
903
ALTER FUNCTION public.hmac(text, text, text) OWNER TO postgres;
906
-- TOC entry 34 (class 1255 OID 17800)
908
-- Name: hmac(bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
911
CREATE FUNCTION hmac(bytea, bytea, text) RETURNS bytea
912
AS '$libdir/pgcrypto', 'pg_hmac'
913
LANGUAGE c IMMUTABLE STRICT;
916
ALTER FUNCTION public.hmac(bytea, bytea, text) OWNER TO postgres;
919
-- TOC entry 35 (class 1255 OID 17801)
921
-- Name: pgp_key_id(bytea); Type: FUNCTION; Schema: public; Owner: postgres
924
CREATE FUNCTION pgp_key_id(bytea) RETURNS text
925
AS '$libdir/pgcrypto', 'pgp_key_id_w'
926
LANGUAGE c IMMUTABLE STRICT;
929
ALTER FUNCTION public.pgp_key_id(bytea) OWNER TO postgres;
932
-- TOC entry 36 (class 1255 OID 17802)
934
-- Name: pgp_pub_decrypt(bytea, bytea); Type: FUNCTION; Schema: public; Owner: postgres
937
CREATE FUNCTION pgp_pub_decrypt(bytea, bytea) RETURNS text
938
AS '$libdir/pgcrypto', 'pgp_pub_decrypt_text'
939
LANGUAGE c IMMUTABLE STRICT;
942
ALTER FUNCTION public.pgp_pub_decrypt(bytea, bytea) OWNER TO postgres;
945
-- TOC entry 37 (class 1255 OID 17803)
947
-- Name: pgp_pub_decrypt(bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
950
CREATE FUNCTION pgp_pub_decrypt(bytea, bytea, text) RETURNS text
951
AS '$libdir/pgcrypto', 'pgp_pub_decrypt_text'
952
LANGUAGE c IMMUTABLE STRICT;
955
ALTER FUNCTION public.pgp_pub_decrypt(bytea, bytea, text) OWNER TO postgres;
958
-- TOC entry 38 (class 1255 OID 17804)
960
-- Name: pgp_pub_decrypt(bytea, bytea, text, text); Type: FUNCTION; Schema: public; Owner: postgres
963
CREATE FUNCTION pgp_pub_decrypt(bytea, bytea, text, text) RETURNS text
964
AS '$libdir/pgcrypto', 'pgp_pub_decrypt_text'
965
LANGUAGE c IMMUTABLE STRICT;
968
ALTER FUNCTION public.pgp_pub_decrypt(bytea, bytea, text, text) OWNER TO postgres;
971
-- TOC entry 39 (class 1255 OID 17805)
973
-- Name: pgp_pub_decrypt_bytea(bytea, bytea); Type: FUNCTION; Schema: public; Owner: postgres
976
CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea) RETURNS bytea
977
AS '$libdir/pgcrypto', 'pgp_pub_decrypt_bytea'
978
LANGUAGE c IMMUTABLE STRICT;
981
ALTER FUNCTION public.pgp_pub_decrypt_bytea(bytea, bytea) OWNER TO postgres;
984
-- TOC entry 40 (class 1255 OID 17806)
986
-- Name: pgp_pub_decrypt_bytea(bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
989
CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text) RETURNS bytea
990
AS '$libdir/pgcrypto', 'pgp_pub_decrypt_bytea'
991
LANGUAGE c IMMUTABLE STRICT;
994
ALTER FUNCTION public.pgp_pub_decrypt_bytea(bytea, bytea, text) OWNER TO postgres;
997
-- TOC entry 41 (class 1255 OID 17807)
999
-- Name: pgp_pub_decrypt_bytea(bytea, bytea, text, text); Type: FUNCTION; Schema: public; Owner: postgres
1002
CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text) RETURNS bytea
1003
AS '$libdir/pgcrypto', 'pgp_pub_decrypt_bytea'
1004
LANGUAGE c IMMUTABLE STRICT;
1007
ALTER FUNCTION public.pgp_pub_decrypt_bytea(bytea, bytea, text, text) OWNER TO postgres;
1010
-- TOC entry 42 (class 1255 OID 17808)
1012
-- Name: pgp_pub_encrypt(text, bytea); Type: FUNCTION; Schema: public; Owner: postgres
1015
CREATE FUNCTION pgp_pub_encrypt(text, bytea) RETURNS bytea
1016
AS '$libdir/pgcrypto', 'pgp_pub_encrypt_text'
1020
ALTER FUNCTION public.pgp_pub_encrypt(text, bytea) OWNER TO postgres;
1023
-- TOC entry 43 (class 1255 OID 17809)
1025
-- Name: pgp_pub_encrypt(text, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
1028
CREATE FUNCTION pgp_pub_encrypt(text, bytea, text) RETURNS bytea
1029
AS '$libdir/pgcrypto', 'pgp_pub_encrypt_text'
1033
ALTER FUNCTION public.pgp_pub_encrypt(text, bytea, text) OWNER TO postgres;
1036
-- TOC entry 44 (class 1255 OID 17810)
1038
-- Name: pgp_pub_encrypt_bytea(bytea, bytea); Type: FUNCTION; Schema: public; Owner: postgres
1041
CREATE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea) RETURNS bytea
1042
AS '$libdir/pgcrypto', 'pgp_pub_encrypt_bytea'
1046
ALTER FUNCTION public.pgp_pub_encrypt_bytea(bytea, bytea) OWNER TO postgres;
1049
-- TOC entry 45 (class 1255 OID 17811)
1051
-- Name: pgp_pub_encrypt_bytea(bytea, bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
1054
CREATE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text) RETURNS bytea
1055
AS '$libdir/pgcrypto', 'pgp_pub_encrypt_bytea'
1059
ALTER FUNCTION public.pgp_pub_encrypt_bytea(bytea, bytea, text) OWNER TO postgres;
1062
-- TOC entry 46 (class 1255 OID 17812)
1064
-- Name: pgp_sym_decrypt(bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
1067
CREATE FUNCTION pgp_sym_decrypt(bytea, text) RETURNS text
1068
AS '$libdir/pgcrypto', 'pgp_sym_decrypt_text'
1069
LANGUAGE c IMMUTABLE STRICT;
1072
ALTER FUNCTION public.pgp_sym_decrypt(bytea, text) OWNER TO postgres;
1075
-- TOC entry 47 (class 1255 OID 17813)
1077
-- Name: pgp_sym_decrypt(bytea, text, text); Type: FUNCTION; Schema: public; Owner: postgres
1080
CREATE FUNCTION pgp_sym_decrypt(bytea, text, text) RETURNS text
1081
AS '$libdir/pgcrypto', 'pgp_sym_decrypt_text'
1082
LANGUAGE c IMMUTABLE STRICT;
1085
ALTER FUNCTION public.pgp_sym_decrypt(bytea, text, text) OWNER TO postgres;
1088
-- TOC entry 48 (class 1255 OID 17814)
1090
-- Name: pgp_sym_decrypt_bytea(bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
1093
CREATE FUNCTION pgp_sym_decrypt_bytea(bytea, text) RETURNS bytea
1094
AS '$libdir/pgcrypto', 'pgp_sym_decrypt_bytea'
1095
LANGUAGE c IMMUTABLE STRICT;
1098
ALTER FUNCTION public.pgp_sym_decrypt_bytea(bytea, text) OWNER TO postgres;
1101
-- TOC entry 49 (class 1255 OID 17815)
1103
-- Name: pgp_sym_decrypt_bytea(bytea, text, text); Type: FUNCTION; Schema: public; Owner: postgres
1106
CREATE FUNCTION pgp_sym_decrypt_bytea(bytea, text, text) RETURNS bytea
1107
AS '$libdir/pgcrypto', 'pgp_sym_decrypt_bytea'
1108
LANGUAGE c IMMUTABLE STRICT;
1111
ALTER FUNCTION public.pgp_sym_decrypt_bytea(bytea, text, text) OWNER TO postgres;
1114
-- TOC entry 50 (class 1255 OID 17816)
1116
-- Name: pgp_sym_encrypt(text, text); Type: FUNCTION; Schema: public; Owner: postgres
1119
CREATE FUNCTION pgp_sym_encrypt(text, text) RETURNS bytea
1120
AS '$libdir/pgcrypto', 'pgp_sym_encrypt_text'
1124
ALTER FUNCTION public.pgp_sym_encrypt(text, text) OWNER TO postgres;
1127
-- TOC entry 51 (class 1255 OID 17817)
1129
-- Name: pgp_sym_encrypt(text, text, text); Type: FUNCTION; Schema: public; Owner: postgres
1132
CREATE FUNCTION pgp_sym_encrypt(text, text, text) RETURNS bytea
1133
AS '$libdir/pgcrypto', 'pgp_sym_encrypt_text'
1137
ALTER FUNCTION public.pgp_sym_encrypt(text, text, text) OWNER TO postgres;
1140
-- TOC entry 52 (class 1255 OID 17818)
1142
-- Name: pgp_sym_encrypt_bytea(bytea, text); Type: FUNCTION; Schema: public; Owner: postgres
1145
CREATE FUNCTION pgp_sym_encrypt_bytea(bytea, text) RETURNS bytea
1146
AS '$libdir/pgcrypto', 'pgp_sym_encrypt_bytea'
1150
ALTER FUNCTION public.pgp_sym_encrypt_bytea(bytea, text) OWNER TO postgres;
1153
-- TOC entry 53 (class 1255 OID 17819)
1155
-- Name: pgp_sym_encrypt_bytea(bytea, text, text); Type: FUNCTION; Schema: public; Owner: postgres
1158
CREATE FUNCTION pgp_sym_encrypt_bytea(bytea, text, text) RETURNS bytea
1159
AS '$libdir/pgcrypto', 'pgp_sym_encrypt_bytea'
1163
ALTER FUNCTION public.pgp_sym_encrypt_bytea(bytea, text, text) OWNER TO postgres;
1166
-- TOC entry 54 (class 1255 OID 17820)
1167
-- Dependencies: 6 551
1168
-- Name: prob_desc_index(); Type: FUNCTION; Schema: public; Owner: postgres
1171
CREATE FUNCTION prob_desc_index() RETURNS trigger
1176
select str_list(tl.name) into tag_list from prob_tags as tgs join prob_tag_list as tl on tgs.tagid=tl.tagid where probid=NEW.problemid;
1177
new.clean_desc := strip_html(NEW.description);
1178
new.parsed_document :=
1179
setweight(to_tsvector(NEW.name),'A') ||
1180
setweight(to_tsvector(NEW.unixname),'B') ||
1181
setweight(to_tsvector(tag_list),'B') ||
1182
setweight(to_tsvector(NEW.clean_desc),'C') ||
1183
setweight(to_tsvector(NEW.sampleinput),'D') ||
1184
setweight(to_tsvector(NEW.sampleoutput),'D');
1191
ALTER FUNCTION public.prob_desc_index() OWNER TO postgres;
1194
-- TOC entry 55 (class 1255 OID 17821)
1195
-- Dependencies: 6 551
1196
-- Name: prob_desc_update(); Type: FUNCTION; Schema: public; Owner: codescore
1199
CREATE FUNCTION prob_desc_update() RETURNS trigger
1202
update prob_list set description = NEW.description, sampleinput=NEW.sampleinput, sampleoutput=NEW.sampleoutput WHERE problemid = NEW.problemid;
1208
ALTER FUNCTION public.prob_desc_update() OWNER TO codescore;
1211
-- TOC entry 56 (class 1255 OID 17822)
1212
-- Dependencies: 6 551
1213
-- Name: prob_reindex_all(); Type: FUNCTION; Schema: public; Owner: postgres
1216
CREATE FUNCTION prob_reindex_all() RETURNS integer
1223
for pr IN SELECT problemid from prob_list order by problemid LOOP
1224
PERFORM reindex_prob(pr.problemid);
1230
LANGUAGE plpgsql COST 900;
1233
ALTER FUNCTION public.prob_reindex_all() OWNER TO postgres;
1236
-- TOC entry 57 (class 1255 OID 17823)
1237
-- Dependencies: 551 6
1238
-- Name: prob_reindex_trigger(); Type: FUNCTION; Schema: public; Owner: postgres
1241
CREATE FUNCTION prob_reindex_trigger() RETURNS trigger
1246
new:=reindex_prob(new);
1253
ALTER FUNCTION public.prob_reindex_trigger() OWNER TO postgres;
1256
-- TOC entry 58 (class 1255 OID 17824)
1257
-- Dependencies: 6 415
1258
-- Name: prob_search(tsquery); Type: FUNCTION; Schema: public; Owner: postgres
1261
CREATE FUNCTION prob_search(tsq tsquery) RETURNS SETOF prob_ts_result
1265
ts_rank(parsed_document,$1) ,
1266
ts_headline('english',pl.description,$1),
1267
pl.problemid)::prob_ts_result) as result
1268
FROM prob_list as pl where parsed_document @@ $1 ORDER BY ts_rank(parsed_document,$1);
1270
LANGUAGE sql COST 300 ROWS 100;
1273
ALTER FUNCTION public.prob_search(tsq tsquery) OWNER TO postgres;
1276
-- TOC entry 59 (class 1255 OID 17825)
1277
-- Dependencies: 6 551
1278
-- Name: prob_tag_reindex(); Type: FUNCTION; Schema: public; Owner: postgres
1281
CREATE FUNCTION prob_tag_reindex() RETURNS trigger
1286
prob:=reindex_prob(NEW.probid);
1293
ALTER FUNCTION public.prob_tag_reindex() OWNER TO postgres;
1296
-- TOC entry 60 (class 1255 OID 17826)
1297
-- Dependencies: 387 6 551 387
1298
-- Name: reindex_prob(prob_list); Type: FUNCTION; Schema: public; Owner: postgres
1301
CREATE FUNCTION reindex_prob(prob_list) RETURNS prob_list
1306
select str_list(tl.name) into tag_list from prob_tags as tgs join prob_tag_list as tl on tgs.tagid=tl.tagid where probid=$1.problemid;
1307
$1.clean_desc := strip_html($1.description);
1308
$1.parsed_document :=
1309
setweight(to_tsvector($1.name),'A') ||
1310
setweight(to_tsvector($1.unixname),'B') ||
1311
setweight(to_tsvector(tag_list),'B') ||
1312
setweight(to_tsvector($1.clean_desc),'C') ||
1313
setweight(to_tsvector($1.sampleinput),'D') ||
1314
setweight(to_tsvector($1.sampleoutput),'D');
1321
ALTER FUNCTION public.reindex_prob(prob_list) OWNER TO postgres;
1324
-- TOC entry 61 (class 1255 OID 17827)
1325
-- Dependencies: 551 6 387
1326
-- Name: reindex_prob(integer); Type: FUNCTION; Schema: public; Owner: postgres
1329
CREATE FUNCTION reindex_prob(integer) RETURNS prob_list
1334
select * into pl from prob_list where problemid=$1;
1335
pl:=reindex_prob(pl);
1336
update prob_list set parsed_document=pl.parsed_document, clean_desc=pl.clean_desc where problemid=pl.problemid;
1343
ALTER FUNCTION public.reindex_prob(integer) OWNER TO postgres;
1346
-- TOC entry 62 (class 1255 OID 17828)
1348
-- Name: str_list_add(text, text); Type: FUNCTION; Schema: public; Owner: postgres
1351
CREATE FUNCTION str_list_add(text, text) RETURNS text
1353
SELECT ($1||' '||$2)::text;
1355
LANGUAGE sql IMMUTABLE;
1358
ALTER FUNCTION public.str_list_add(text, text) OWNER TO postgres;
1361
-- TOC entry 63 (class 1255 OID 17829)
1363
-- Name: strip_html(text); Type: FUNCTION; Schema: public; Owner: postgres
1366
CREATE FUNCTION strip_html(text) RETURNS text
1368
select regexp_replace(lower($1),'<[^>]+>|</[^>]*>','','ig');
1370
LANGUAGE sql IMMUTABLE;
1373
ALTER FUNCTION public.strip_html(text) OWNER TO postgres;
1376
-- TOC entry 552 (class 1255 OID 17830)
1377
-- Dependencies: 62 6
1378
-- Name: str_list(text); Type: AGGREGATE; Schema: public; Owner: postgres
1381
CREATE AGGREGATE str_list(text) (
1382
SFUNC = str_list_add,
1388
ALTER AGGREGATE public.str_list(text) OWNER TO postgres;
1391
-- TOC entry 1485 (class 2753 OID 17831)
1393
-- Name: gin_tsvector_ops; Type: OPERATOR FAMILY; Schema: public; Owner: acornett
1396
CREATE OPERATOR FAMILY gin_tsvector_ops USING gin;
1399
ALTER OPERATOR FAMILY public.gin_tsvector_ops USING gin OWNER TO acornett;
1402
-- TOC entry 1368 (class 2616 OID 17832)
1403
-- Dependencies: 1485 6
1404
-- Name: gin_tsvector_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
1407
CREATE OPERATOR CLASS gin_tsvector_ops
1408
FOR TYPE tsvector USING gin AS
1410
OPERATOR 1 @@(tsvector,tsquery) ,
1411
OPERATOR 2 @@@(tsvector,tsquery) RECHECK ,
1412
FUNCTION 1 bttextcmp(text,text) ,
1413
FUNCTION 2 gin_extract_tsvector(tsvector,internal) ,
1414
FUNCTION 3 gin_extract_tsquery(tsquery,internal,smallint) ,
1415
FUNCTION 4 gin_tsquery_consistent(internal,smallint,tsquery);
1418
ALTER OPERATOR CLASS public.gin_tsvector_ops USING gin OWNER TO postgres;
1421
-- TOC entry 1486 (class 2753 OID 17839)
1423
-- Name: gist_tp_tsquery_ops; Type: OPERATOR FAMILY; Schema: public; Owner: acornett
1426
CREATE OPERATOR FAMILY gist_tp_tsquery_ops USING gist;
1429
ALTER OPERATOR FAMILY public.gist_tp_tsquery_ops USING gist OWNER TO acornett;
1432
-- TOC entry 1369 (class 2616 OID 17840)
1433
-- Dependencies: 6 1486
1434
-- Name: gist_tp_tsquery_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
1437
CREATE OPERATOR CLASS gist_tp_tsquery_ops
1438
FOR TYPE tsquery USING gist AS
1440
OPERATOR 7 @>(tsquery,tsquery) RECHECK ,
1441
OPERATOR 8 <@(tsquery,tsquery) RECHECK ,
1442
FUNCTION 1 gtsquery_consistent(bigint,internal,integer) ,
1443
FUNCTION 2 gtsquery_union(internal,internal) ,
1444
FUNCTION 3 gtsquery_compress(internal) ,
1445
FUNCTION 4 gtsquery_decompress(internal) ,
1446
FUNCTION 5 gtsquery_penalty(internal,internal,internal) ,
1447
FUNCTION 6 gtsquery_picksplit(internal,internal) ,
1448
FUNCTION 7 gtsquery_same(bigint,bigint,internal);
1451
ALTER OPERATOR CLASS public.gist_tp_tsquery_ops USING gist OWNER TO postgres;
1454
-- TOC entry 1487 (class 2753 OID 17850)
1456
-- Name: gist_tsvector_ops; Type: OPERATOR FAMILY; Schema: public; Owner: acornett
1459
CREATE OPERATOR FAMILY gist_tsvector_ops USING gist;
1462
ALTER OPERATOR FAMILY public.gist_tsvector_ops USING gist OWNER TO acornett;
1465
-- TOC entry 1370 (class 2616 OID 17851)
1466
-- Dependencies: 1487 6
1467
-- Name: gist_tsvector_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
1470
CREATE OPERATOR CLASS gist_tsvector_ops
1471
FOR TYPE tsvector USING gist AS
1473
OPERATOR 1 @@(tsvector,tsquery) RECHECK ,
1474
FUNCTION 1 gtsvector_consistent(gtsvector,internal,integer) ,
1475
FUNCTION 2 gtsvector_union(internal,internal) ,
1476
FUNCTION 3 gtsvector_compress(internal) ,
1477
FUNCTION 4 gtsvector_decompress(internal) ,
1478
FUNCTION 5 gtsvector_penalty(internal,internal,internal) ,
1479
FUNCTION 6 gtsvector_picksplit(internal,internal) ,
1480
FUNCTION 7 gtsvector_same(gtsvector,gtsvector,internal);
1483
ALTER OPERATOR CLASS public.gist_tsvector_ops USING gist OWNER TO postgres;
1486
-- TOC entry 1488 (class 2753 OID 17860)
1488
-- Name: tsquery_ops; Type: OPERATOR FAMILY; Schema: public; Owner: acornett
1491
CREATE OPERATOR FAMILY tsquery_ops USING btree;
1494
ALTER OPERATOR FAMILY public.tsquery_ops USING btree OWNER TO acornett;
1497
-- TOC entry 1371 (class 2616 OID 17861)
1498
-- Dependencies: 1488 6
1499
-- Name: tsquery_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
1502
CREATE OPERATOR CLASS tsquery_ops
1503
FOR TYPE tsquery USING btree AS
1504
OPERATOR 1 <(tsquery,tsquery) ,
1505
OPERATOR 2 <=(tsquery,tsquery) ,
1506
OPERATOR 3 =(tsquery,tsquery) ,
1507
OPERATOR 4 >=(tsquery,tsquery) ,
1508
OPERATOR 5 >(tsquery,tsquery) ,
1509
FUNCTION 1 tsquery_cmp(tsquery,tsquery);
1512
ALTER OPERATOR CLASS public.tsquery_ops USING btree OWNER TO postgres;
1515
-- TOC entry 1489 (class 2753 OID 17868)
1517
-- Name: tsvector_ops; Type: OPERATOR FAMILY; Schema: public; Owner: acornett
1520
CREATE OPERATOR FAMILY tsvector_ops USING btree;
1523
ALTER OPERATOR FAMILY public.tsvector_ops USING btree OWNER TO acornett;
1526
-- TOC entry 1372 (class 2616 OID 17869)
1527
-- Dependencies: 1489 6
1528
-- Name: tsvector_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
1531
CREATE OPERATOR CLASS tsvector_ops
1532
FOR TYPE tsvector USING btree AS
1533
OPERATOR 1 <(tsvector,tsvector) ,
1534
OPERATOR 2 <=(tsvector,tsvector) ,
1535
OPERATOR 3 =(tsvector,tsvector) ,
1536
OPERATOR 4 >=(tsvector,tsvector) ,
1537
OPERATOR 5 >(tsvector,tsvector) ,
1538
FUNCTION 1 tsvector_cmp(tsvector,tsvector);
1541
ALTER OPERATOR CLASS public.tsvector_ops USING btree OWNER TO postgres;
1544
-- TOC entry 1771 (class 1259 OID 17876)
1546
-- Name: pk_ppl_coaches; Type: SEQUENCE; Schema: public; Owner: codescore
1549
CREATE SEQUENCE pk_ppl_coaches
1557
ALTER TABLE public.pk_ppl_coaches OWNER TO codescore;
1560
-- TOC entry 1772 (class 1259 OID 17878)
1562
-- Name: pk_ppl_comps; Type: SEQUENCE; Schema: public; Owner: codescore
1565
CREATE SEQUENCE pk_ppl_comps
1572
ALTER TABLE public.pk_ppl_comps OWNER TO codescore;
1575
-- TOC entry 1774 (class 1259 OID 17882)
1577
-- Name: pk_ppl_judges; Type: SEQUENCE; Schema: public; Owner: codescore
1580
CREATE SEQUENCE pk_ppl_judges
1588
ALTER TABLE public.pk_ppl_judges OWNER TO codescore;
1591
-- TOC entry 1781 (class 1259 OID 17896)
1593
-- Name: pk_prob_set; Type: SEQUENCE; Schema: public; Owner: codescore
1596
CREATE SEQUENCE pk_prob_set
1604
ALTER TABLE public.pk_prob_set OWNER TO codescore;
1607
-- TOC entry 1784 (class 1259 OID 17902)
1609
-- Name: pk_prob_tag_list; Type: SEQUENCE; Schema: public; Owner: codescore
1612
CREATE SEQUENCE pk_prob_tag_list
1620
ALTER TABLE public.pk_prob_tag_list OWNER TO codescore;
1623
-- TOC entry 1785 (class 1259 OID 17904)
1625
-- Name: pk_prob_tags; Type: SEQUENCE; Schema: public; Owner: codescore
1628
CREATE SEQUENCE pk_prob_tags
1636
ALTER TABLE public.pk_prob_tags OWNER TO codescore;
1639
-- TOC entry 1792 (class 1259 OID 17918)
1641
-- Name: pk_team_pass; Type: SEQUENCE; Schema: public; Owner: codescore
1644
CREATE SEQUENCE pk_team_pass
1652
ALTER TABLE public.pk_team_pass OWNER TO codescore;
1655
-- TOC entry 2142 (class 2606 OID 17926)
1656
-- Dependencies: 1745 1745 1745
1657
-- Name: ppl_coaches_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1660
ALTER TABLE ONLY ppl_coaches
1661
ADD CONSTRAINT ppl_coaches_pkey PRIMARY KEY (personid, schoolid);
1665
-- TOC entry 2144 (class 2606 OID 17928)
1666
-- Dependencies: 1746 1746
1667
-- Name: ppl_comps_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1670
ALTER TABLE ONLY ppl_comps
1671
ADD CONSTRAINT ppl_comps_pkey PRIMARY KEY (bad);
1675
-- TOC entry 2146 (class 2606 OID 18715)
1676
-- Dependencies: 1747 1747
1677
-- Name: ppl_email_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1680
ALTER TABLE ONLY ppl_email
1681
ADD CONSTRAINT ppl_email_pkey PRIMARY KEY (emailid);
1685
-- TOC entry 2148 (class 2606 OID 17932)
1686
-- Dependencies: 1747 1747
1687
-- Name: ppl_email_unique; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1690
ALTER TABLE ONLY ppl_email
1691
ADD CONSTRAINT ppl_email_unique UNIQUE (address);
1695
-- TOC entry 2150 (class 2606 OID 17934)
1696
-- Dependencies: 1748 1748 1748
1697
-- Name: ppl_judges_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1700
ALTER TABLE ONLY ppl_judges
1701
ADD CONSTRAINT ppl_judges_pkey PRIMARY KEY (compid, personid);
1705
-- TOC entry 2152 (class 2606 OID 17936)
1706
-- Dependencies: 1749 1749
1707
-- Name: ppl_list_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1710
ALTER TABLE ONLY ppl_list
1711
ADD CONSTRAINT ppl_list_pkey PRIMARY KEY (personid);
1715
-- TOC entry 2154 (class 2606 OID 17938)
1716
-- Dependencies: 1749 1749
1717
-- Name: ppl_name_unique; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1720
ALTER TABLE ONLY ppl_list
1721
ADD CONSTRAINT ppl_name_unique UNIQUE (name);
1725
-- TOC entry 2156 (class 2606 OID 17940)
1726
-- Dependencies: 1750 1750
1727
-- Name: ppl_regions_name; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
1730
ALTER TABLE ONLY ppl_region
1731
ADD CONSTRAINT ppl_regions_name UNIQUE ("Name");
1735
-- TOC entry 2158 (class 2606 OID 17942)
1736
-- Dependencies: 1750 1750
1737
-- Name: ppl_regions_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
1740
ALTER TABLE ONLY ppl_region
1741
ADD CONSTRAINT ppl_regions_pk PRIMARY KEY (regionid);
1745
-- TOC entry 2161 (class 2606 OID 17944)
1746
-- Dependencies: 1752 1752
1747
-- Name: ppl_schools_name_unique; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1750
ALTER TABLE ONLY ppl_schools
1751
ADD CONSTRAINT ppl_schools_name_unique UNIQUE (name);
1755
-- TOC entry 2163 (class 2606 OID 17946)
1756
-- Dependencies: 1752 1752
1757
-- Name: ppl_schools_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1760
ALTER TABLE ONLY ppl_schools
1761
ADD CONSTRAINT ppl_schools_pkey PRIMARY KEY (schoolid);
1765
-- TOC entry 2202 (class 2606 OID 18154)
1766
-- Dependencies: 1794 1794
1767
-- Name: prob_cases_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1770
ALTER TABLE ONLY prob_cases
1771
ADD CONSTRAINT prob_cases_pkey PRIMARY KEY (caseid);
1775
-- TOC entry 2165 (class 2606 OID 17950)
1776
-- Dependencies: 1754 1754
1777
-- Name: prob_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1780
ALTER TABLE ONLY prob_comments
1781
ADD CONSTRAINT prob_comments_pkey PRIMARY KEY (comid);
1785
-- TOC entry 2167 (class 2606 OID 17952)
1786
-- Dependencies: 1755 1755
1787
-- Name: prob_descfigs_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1790
ALTER TABLE ONLY prob_descfigs
1791
ADD CONSTRAINT prob_descfigs_pkey PRIMARY KEY (figid);
1795
-- TOC entry 2169 (class 2606 OID 17954)
1796
-- Dependencies: 1756 1756
1797
-- Name: prob_list_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1800
ALTER TABLE ONLY prob_list
1801
ADD CONSTRAINT prob_list_pkey PRIMARY KEY (problemid);
1805
-- TOC entry 2174 (class 2606 OID 17956)
1806
-- Dependencies: 1757 1757 1757
1807
-- Name: prob_set_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1810
ALTER TABLE ONLY prob_set
1811
ADD CONSTRAINT prob_set_pkey PRIMARY KEY (compid, probid);
1815
-- TOC entry 2176 (class 2606 OID 18723)
1816
-- Dependencies: 1758 1758
1817
-- Name: prob_solutions_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1820
ALTER TABLE ONLY prob_solutions
1821
ADD CONSTRAINT prob_solutions_pkey PRIMARY KEY (sid);
1825
-- TOC entry 2178 (class 2606 OID 17960)
1826
-- Dependencies: 1759 1759
1827
-- Name: prob_status_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1830
ALTER TABLE ONLY prob_status
1831
ADD CONSTRAINT prob_status_pkey PRIMARY KEY (statid);
1835
-- TOC entry 2180 (class 2606 OID 17962)
1836
-- Dependencies: 1760 1760
1837
-- Name: prob_tag_list_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1840
ALTER TABLE ONLY prob_tag_list
1841
ADD CONSTRAINT prob_tag_list_pkey PRIMARY KEY (tagid);
1845
-- TOC entry 2184 (class 2606 OID 17964)
1846
-- Dependencies: 1761 1761 1761
1847
-- Name: prob_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1850
ALTER TABLE ONLY prob_tags
1851
ADD CONSTRAINT prob_tags_pkey PRIMARY KEY (probid, tagid);
1855
-- TOC entry 2172 (class 2606 OID 17966)
1856
-- Dependencies: 1756 1756
1857
-- Name: prob_unixname_unique; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1860
ALTER TABLE ONLY prob_list
1861
ADD CONSTRAINT prob_unixname_unique UNIQUE (unixname);
1865
-- TOC entry 2186 (class 2606 OID 17968)
1866
-- Dependencies: 1763 1763
1867
-- Name: prob_version_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
1870
ALTER TABLE ONLY prob_versions
1871
ADD CONSTRAINT prob_version_pk PRIMARY KEY (versionid);
1875
-- TOC entry 2188 (class 2606 OID 17970)
1876
-- Dependencies: 1764 1764
1877
-- Name: sys_clari_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1880
ALTER TABLE ONLY sys_clari
1881
ADD CONSTRAINT sys_clari_pkey PRIMARY KEY (cid);
1885
-- TOC entry 2190 (class 2606 OID 17972)
1886
-- Dependencies: 1765 1765
1887
-- Name: sys_compargs_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1890
ALTER TABLE ONLY sys_compargs
1891
ADD CONSTRAINT sys_compargs_pkey PRIMARY KEY (argid);
1895
-- TOC entry 2192 (class 2606 OID 17974)
1896
-- Dependencies: 1766 1766
1897
-- Name: sys_comps_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1900
ALTER TABLE ONLY sys_comps
1901
ADD CONSTRAINT sys_comps_pkey PRIMARY KEY (compid);
1905
-- TOC entry 2194 (class 2606 OID 17976)
1906
-- Dependencies: 1767 1767
1907
-- Name: sys_exeargs_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1910
ALTER TABLE ONLY sys_exeargs
1911
ADD CONSTRAINT sys_exeargs_pkey PRIMARY KEY (argid);
1915
-- TOC entry 2196 (class 2606 OID 17978)
1916
-- Dependencies: 1768 1768
1917
-- Name: sys_langs_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1920
ALTER TABLE ONLY sys_langs
1921
ADD CONSTRAINT sys_langs_pkey PRIMARY KEY (lid);
1925
-- TOC entry 2182 (class 2606 OID 18727)
1926
-- Dependencies: 1760 1760
1927
-- Name: tag_name_unique; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1930
ALTER TABLE ONLY prob_tag_list
1931
ADD CONSTRAINT tag_name_unique UNIQUE (name);
1935
-- TOC entry 2198 (class 2606 OID 17980)
1936
-- Dependencies: 1769 1769
1937
-- Name: team_list_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1940
ALTER TABLE ONLY team_list
1941
ADD CONSTRAINT team_list_pkey PRIMARY KEY (teamid);
1945
-- TOC entry 2200 (class 2606 OID 18243)
1946
-- Dependencies: 1770 1770
1947
-- Name: team_subs_pkey; Type: CONSTRAINT; Schema: public; Owner: codescore; Tablespace:
1950
ALTER TABLE ONLY team_subs
1951
ADD CONSTRAINT team_subs_pkey PRIMARY KEY (subid);
1955
-- TOC entry 2159 (class 1259 OID 17983)
1956
-- Dependencies: 1752
1957
-- Name: fki_ppl_school_region; Type: INDEX; Schema: public; Owner: codescore; Tablespace:
1960
CREATE INDEX fki_ppl_school_region ON ppl_schools USING btree (regionid);
1964
-- TOC entry 2170 (class 1259 OID 17984)
1965
-- Dependencies: 1756
1966
-- Name: prob_ts; Type: INDEX; Schema: public; Owner: codescore; Tablespace:
1969
CREATE INDEX prob_ts ON prob_list USING gin (parsed_document);
1973
-- TOC entry 2233 (class 2620 OID 17985)
1974
-- Dependencies: 59 1761
1975
-- Name: prob_tag_index; Type: TRIGGER; Schema: public; Owner: codescore
1978
CREATE TRIGGER prob_tag_index
1979
AFTER INSERT OR DELETE OR UPDATE ON prob_tags
1981
EXECUTE PROCEDURE prob_tag_reindex();
1985
-- TOC entry 2234 (class 2620 OID 17986)
1986
-- Dependencies: 1763 55
1987
-- Name: update_prob_desc; Type: TRIGGER; Schema: public; Owner: postgres
1990
CREATE TRIGGER update_prob_desc
1991
AFTER INSERT OR UPDATE ON prob_versions
1993
EXECUTE PROCEDURE prob_desc_update();
1997
-- TOC entry 2232 (class 2620 OID 17987)
1998
-- Dependencies: 1756 57
1999
-- Name: update_prob_index; Type: TRIGGER; Schema: public; Owner: codescore
2002
CREATE TRIGGER update_prob_index
2003
BEFORE INSERT OR UPDATE ON prob_list
2005
EXECUTE PROCEDURE prob_reindex_trigger();
2009
-- TOC entry 2203 (class 2606 OID 17988)
2010
-- Dependencies: 1745 2151 1749
2011
-- Name: ppl_coaches_personid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2014
ALTER TABLE ONLY ppl_coaches
2015
ADD CONSTRAINT ppl_coaches_personid_fkey FOREIGN KEY (personid) REFERENCES ppl_list(personid) ON UPDATE CASCADE ON DELETE CASCADE;
2019
-- TOC entry 2204 (class 2606 OID 17993)
2020
-- Dependencies: 1752 2162 1745
2021
-- Name: ppl_coaches_schoolid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2024
ALTER TABLE ONLY ppl_coaches
2025
ADD CONSTRAINT ppl_coaches_schoolid_fkey FOREIGN KEY (schoolid) REFERENCES ppl_schools(schoolid) ON UPDATE CASCADE ON DELETE CASCADE;
2029
-- TOC entry 2205 (class 2606 OID 17998)
2030
-- Dependencies: 1766 1746 2191
2031
-- Name: ppl_comps_cid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2034
ALTER TABLE ONLY ppl_comps
2035
ADD CONSTRAINT ppl_comps_cid_fkey FOREIGN KEY (cid) REFERENCES sys_comps(compid) ON UPDATE CASCADE ON DELETE CASCADE;
2039
-- TOC entry 2206 (class 2606 OID 18003)
2040
-- Dependencies: 1749 2151 1746
2041
-- Name: ppl_comps_pid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2044
ALTER TABLE ONLY ppl_comps
2045
ADD CONSTRAINT ppl_comps_pid_fkey FOREIGN KEY (pid) REFERENCES ppl_list(personid) ON UPDATE CASCADE ON DELETE CASCADE;
2049
-- TOC entry 2207 (class 2606 OID 18008)
2050
-- Dependencies: 1746 1769 2197
2051
-- Name: ppl_comps_tid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2054
ALTER TABLE ONLY ppl_comps
2055
ADD CONSTRAINT ppl_comps_tid_fkey FOREIGN KEY (tid) REFERENCES team_list(teamid) ON UPDATE CASCADE ON DELETE CASCADE;
2059
-- TOC entry 2208 (class 2606 OID 18013)
2060
-- Dependencies: 2151 1747 1749
2061
-- Name: ppl_email_personid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2064
ALTER TABLE ONLY ppl_email
2065
ADD CONSTRAINT ppl_email_personid_fkey FOREIGN KEY (personid) REFERENCES ppl_list(personid) ON UPDATE CASCADE ON DELETE CASCADE;
2069
-- TOC entry 2209 (class 2606 OID 18018)
2070
-- Dependencies: 1766 1748 2191
2071
-- Name: ppl_judges_compid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2074
ALTER TABLE ONLY ppl_judges
2075
ADD CONSTRAINT ppl_judges_compid_fkey FOREIGN KEY (compid) REFERENCES sys_comps(compid) ON UPDATE CASCADE ON DELETE CASCADE;
2079
-- TOC entry 2210 (class 2606 OID 18023)
2080
-- Dependencies: 1749 2151 1748
2081
-- Name: ppl_judges_personid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2084
ALTER TABLE ONLY ppl_judges
2085
ADD CONSTRAINT ppl_judges_personid_fkey FOREIGN KEY (personid) REFERENCES ppl_list(personid) ON UPDATE CASCADE ON DELETE CASCADE;
2089
-- TOC entry 2211 (class 2606 OID 18028)
2090
-- Dependencies: 2157 1752 1750
2091
-- Name: ppl_school_region; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2094
ALTER TABLE ONLY ppl_schools
2095
ADD CONSTRAINT ppl_school_region FOREIGN KEY (regionid) REFERENCES ppl_region(regionid) ON UPDATE CASCADE ON DELETE CASCADE;
2099
-- TOC entry 2231 (class 2606 OID 18155)
2100
-- Dependencies: 1794 1756 2168
2101
-- Name: prob_cases_probid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2104
ALTER TABLE ONLY prob_cases
2105
ADD CONSTRAINT prob_cases_probid_fkey FOREIGN KEY (probid) REFERENCES prob_list(problemid) ON UPDATE CASCADE;
2109
-- TOC entry 2212 (class 2606 OID 18038)
2110
-- Dependencies: 2151 1754 1749
2111
-- Name: prob_comments_personid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2114
ALTER TABLE ONLY prob_comments
2115
ADD CONSTRAINT prob_comments_personid_fkey FOREIGN KEY (personid) REFERENCES ppl_list(personid) ON UPDATE CASCADE ON DELETE CASCADE;
2119
-- TOC entry 2213 (class 2606 OID 18043)
2120
-- Dependencies: 1756 1754 2168
2121
-- Name: prob_comments_probid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2124
ALTER TABLE ONLY prob_comments
2125
ADD CONSTRAINT prob_comments_probid_fkey FOREIGN KEY (probid) REFERENCES prob_list(problemid) ON UPDATE CASCADE ON DELETE CASCADE;
2129
-- TOC entry 2214 (class 2606 OID 18048)
2130
-- Dependencies: 1755 1756 2168
2131
-- Name: prob_descfigs_figid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2134
ALTER TABLE ONLY prob_descfigs
2135
ADD CONSTRAINT prob_descfigs_figid_fkey FOREIGN KEY (figid) REFERENCES prob_list(problemid) ON UPDATE CASCADE ON DELETE CASCADE;
2139
-- TOC entry 2215 (class 2606 OID 18053)
2140
-- Dependencies: 1757 2191 1766
2141
-- Name: prob_set_compid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2144
ALTER TABLE ONLY prob_set
2145
ADD CONSTRAINT prob_set_compid_fkey FOREIGN KEY (compid) REFERENCES sys_comps(compid) ON UPDATE CASCADE ON DELETE CASCADE;
2149
-- TOC entry 2216 (class 2606 OID 18058)
2150
-- Dependencies: 1756 2168 1757
2151
-- Name: prob_set_probid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2154
ALTER TABLE ONLY prob_set
2155
ADD CONSTRAINT prob_set_probid_fkey FOREIGN KEY (probid) REFERENCES prob_list(problemid) ON UPDATE CASCADE ON DELETE CASCADE;
2159
-- TOC entry 2217 (class 2606 OID 18063)
2160
-- Dependencies: 1768 1758 2195
2161
-- Name: prob_solutions_langid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2164
ALTER TABLE ONLY prob_solutions
2165
ADD CONSTRAINT prob_solutions_langid_fkey FOREIGN KEY (langid) REFERENCES sys_langs(lid) ON UPDATE CASCADE ON DELETE CASCADE;
2169
-- TOC entry 2218 (class 2606 OID 18068)
2170
-- Dependencies: 1756 2168 1758
2171
-- Name: prob_solutions_pid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2174
ALTER TABLE ONLY prob_solutions
2175
ADD CONSTRAINT prob_solutions_pid_fkey FOREIGN KEY (pid) REFERENCES prob_list(problemid) ON UPDATE CASCADE ON DELETE CASCADE;
2179
-- TOC entry 2219 (class 2606 OID 18073)
2180
-- Dependencies: 1758 1759 2177
2181
-- Name: prob_solutions_stat_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2184
ALTER TABLE ONLY prob_solutions
2185
ADD CONSTRAINT prob_solutions_stat_fkey FOREIGN KEY (stat) REFERENCES prob_status(statid) ON UPDATE CASCADE ON DELETE CASCADE;
2189
-- TOC entry 2220 (class 2606 OID 18078)
2190
-- Dependencies: 1761 2168 1756
2191
-- Name: prob_tags_probid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2194
ALTER TABLE ONLY prob_tags
2195
ADD CONSTRAINT prob_tags_probid_fkey FOREIGN KEY (probid) REFERENCES prob_list(problemid) ON UPDATE CASCADE ON DELETE CASCADE;
2199
-- TOC entry 2221 (class 2606 OID 18083)
2200
-- Dependencies: 1761 1760 2179
2201
-- Name: prob_tags_tagid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2204
ALTER TABLE ONLY prob_tags
2205
ADD CONSTRAINT prob_tags_tagid_fkey FOREIGN KEY (tagid) REFERENCES prob_tag_list(tagid) ON UPDATE CASCADE ON DELETE CASCADE;
2209
-- TOC entry 2222 (class 2606 OID 18088)
2210
-- Dependencies: 2151 1763 1749
2211
-- Name: prob_version_person; Type: FK CONSTRAINT; Schema: public; Owner: postgres
2214
ALTER TABLE ONLY prob_versions
2215
ADD CONSTRAINT prob_version_person FOREIGN KEY (personid) REFERENCES ppl_list(personid) ON UPDATE CASCADE ON DELETE RESTRICT;
2219
-- TOC entry 2223 (class 2606 OID 18093)
2220
-- Dependencies: 1764 1766 2191
2221
-- Name: sys_clari_compid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2224
ALTER TABLE ONLY sys_clari
2225
ADD CONSTRAINT sys_clari_compid_fkey FOREIGN KEY (compid) REFERENCES sys_comps(compid) ON UPDATE CASCADE ON DELETE CASCADE;
2229
-- TOC entry 2224 (class 2606 OID 18098)
2230
-- Dependencies: 2195 1768 1765
2231
-- Name: sys_compargs_langid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2234
ALTER TABLE ONLY sys_compargs
2235
ADD CONSTRAINT sys_compargs_langid_fkey FOREIGN KEY (langid) REFERENCES sys_langs(lid) ON UPDATE CASCADE ON DELETE CASCADE;
2239
-- TOC entry 2225 (class 2606 OID 18103)
2240
-- Dependencies: 2195 1768 1767
2241
-- Name: sys_exeargs_langid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2244
ALTER TABLE ONLY sys_exeargs
2245
ADD CONSTRAINT sys_exeargs_langid_fkey FOREIGN KEY (langid) REFERENCES sys_langs(lid) ON UPDATE CASCADE ON DELETE CASCADE;
2249
-- TOC entry 2226 (class 2606 OID 18108)
2250
-- Dependencies: 2162 1752 1769
2251
-- Name: team_list_school_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2254
ALTER TABLE ONLY team_list
2255
ADD CONSTRAINT team_list_school_fkey FOREIGN KEY (schoolid) REFERENCES ppl_schools(schoolid) ON UPDATE CASCADE ON DELETE CASCADE;
2259
-- TOC entry 2227 (class 2606 OID 18113)
2260
-- Dependencies: 1770 1768 2195
2261
-- Name: team_subs_langid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2264
ALTER TABLE ONLY team_subs
2265
ADD CONSTRAINT team_subs_langid_fkey FOREIGN KEY (langid) REFERENCES sys_langs(lid) ON UPDATE CASCADE ON DELETE CASCADE;
2269
-- TOC entry 2228 (class 2606 OID 18118)
2270
-- Dependencies: 1770 1756 2168
2271
-- Name: team_subs_pid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2274
ALTER TABLE ONLY team_subs
2275
ADD CONSTRAINT team_subs_pid_fkey FOREIGN KEY (pid) REFERENCES prob_list(problemid) ON UPDATE CASCADE ON DELETE CASCADE;
2279
-- TOC entry 2229 (class 2606 OID 18123)
2280
-- Dependencies: 2177 1759 1770
2281
-- Name: team_subs_stat_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2284
ALTER TABLE ONLY team_subs
2285
ADD CONSTRAINT team_subs_stat_fkey FOREIGN KEY (stat) REFERENCES prob_status(statid) ON UPDATE CASCADE ON DELETE CASCADE;
2289
-- TOC entry 2230 (class 2606 OID 18128)
2290
-- Dependencies: 2197 1770 1769
2291
-- Name: team_subs_tid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codescore
2294
ALTER TABLE ONLY team_subs
2295
ADD CONSTRAINT team_subs_tid_fkey FOREIGN KEY (tid) REFERENCES team_list(teamid) ON UPDATE CASCADE ON DELETE CASCADE;
2299
-- TOC entry 2238 (class 0 OID 0)
2301
-- Name: public; Type: ACL; Schema: -; Owner: postgres
2304
REVOKE ALL ON SCHEMA public FROM PUBLIC;
2305
REVOKE ALL ON SCHEMA public FROM postgres;
2306
GRANT ALL ON SCHEMA public TO postgres;
2307
GRANT ALL ON SCHEMA public TO PUBLIC;
2310
-- Completed on 2008-05-15 17:56:21 EDT
2313
-- PostgreSQL database dump complete