Serial columns now 64 bits.
[cocanwiki.git] / cocanwiki.sql
1 --
2 -- PostgreSQL database dump
3 --
4
5 SET client_encoding = 'UNICODE';
6 SET check_function_bodies = false;
7
8 --
9 -- TOC entry 4 (OID 2200)
10 -- Name: public; Type: ACL; Schema: -; Owner: postgres
11 --
12
13 REVOKE ALL ON SCHEMA public FROM PUBLIC;
14 REVOKE ALL ON SCHEMA public FROM postgres;
15 GRANT ALL ON SCHEMA public TO PUBLIC;
16
17
18 SET search_path = public, pg_catalog;
19
20 --
21 -- TOC entry 12 (OID 536004)
22 -- Name: pages; Type: TABLE; Schema: public; Owner: rich
23 --
24
25 CREATE TABLE pages (
26     id serial NOT NULL,
27     url text,
28     url_deleted text,
29     title text NOT NULL,
30     description text NOT NULL,
31     creation_date timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL,
32     last_modified_date timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL,
33     hostid integer NOT NULL,
34     logged_ip text,
35     redirect text,
36     css text,
37     logged_user integer,
38     title_description_fti tsvector NOT NULL
39 );
40
41
42 --
43 -- TOC entry 13 (OID 536004)
44 -- Name: pages; Type: ACL; Schema: public; Owner: rich
45 --
46
47 REVOKE ALL ON TABLE pages FROM PUBLIC;
48 GRANT ALL ON TABLE pages TO "www-data";
49
50
51 --
52 -- TOC entry 65 (OID 536004)
53 -- Name: pages_id_seq; Type: ACL; Schema: public; Owner: rich
54 --
55
56 REVOKE ALL ON TABLE pages_id_seq FROM PUBLIC;
57 GRANT ALL ON TABLE pages_id_seq TO "www-data";
58
59
60 --
61 -- TOC entry 14 (OID 536021)
62 -- Name: contents; Type: TABLE; Schema: public; Owner: rich
63 --
64
65 CREATE TABLE contents (
66     id serial NOT NULL,
67     pageid integer NOT NULL,
68     ordering integer NOT NULL,
69     sectionname text,
70     content text NOT NULL,
71     divname text,
72     content_fti tsvector NOT NULL
73 );
74
75
76 --
77 -- TOC entry 15 (OID 536021)
78 -- Name: contents; Type: ACL; Schema: public; Owner: rich
79 --
80
81 REVOKE ALL ON TABLE contents FROM PUBLIC;
82 GRANT ALL ON TABLE contents TO "www-data";
83
84
85 --
86 -- TOC entry 66 (OID 536021)
87 -- Name: contents_id_seq; Type: ACL; Schema: public; Owner: rich
88 --
89
90 REVOKE ALL ON TABLE contents_id_seq FROM PUBLIC;
91 GRANT ALL ON TABLE contents_id_seq TO "www-data";
92
93
94 --
95 -- TOC entry 16 (OID 536371)
96 -- Name: hosts; Type: TABLE; Schema: public; Owner: rich
97 --
98
99 CREATE TABLE hosts (
100     id serial NOT NULL,
101     canonical_hostname text NOT NULL,
102     css text,
103     edit_anon boolean DEFAULT true NOT NULL,
104     create_account_anon boolean DEFAULT true NOT NULL,
105     theme_css text,
106     feedback_email text,
107     mailing_list boolean DEFAULT false NOT NULL,
108     is_template boolean DEFAULT false NOT NULL,
109     search_box boolean DEFAULT true NOT NULL,
110     view_anon boolean DEFAULT true NOT NULL,
111     navigation boolean DEFAULT false NOT NULL,
112     powered_by integer,
113     brand text,
114     brand_tagline text,
115     brand_description text
116 );
117
118
119 --
120 -- TOC entry 17 (OID 536371)
121 -- Name: hosts; Type: ACL; Schema: public; Owner: rich
122 --
123
124 REVOKE ALL ON TABLE hosts FROM PUBLIC;
125 GRANT ALL ON TABLE hosts TO "www-data";
126
127
128 --
129 -- TOC entry 67 (OID 536371)
130 -- Name: hosts_id_seq; Type: ACL; Schema: public; Owner: rich
131 --
132
133 REVOKE ALL ON TABLE hosts_id_seq FROM PUBLIC;
134 GRANT ALL ON TABLE hosts_id_seq TO "www-data";
135
136
137 --
138 -- TOC entry 18 (OID 536379)
139 -- Name: hostnames; Type: TABLE; Schema: public; Owner: rich
140 --
141
142 CREATE TABLE hostnames (
143     hostid integer NOT NULL,
144     name text NOT NULL
145 );
146
147
148 --
149 -- TOC entry 19 (OID 536379)
150 -- Name: hostnames; Type: ACL; Schema: public; Owner: rich
151 --
152
153 REVOKE ALL ON TABLE hostnames FROM PUBLIC;
154 GRANT ALL ON TABLE hostnames TO "www-data";
155
156
157 --
158 -- TOC entry 20 (OID 537151)
159 -- Name: images; Type: TABLE; Schema: public; Owner: rich
160 --
161
162 CREATE TABLE images (
163     id serial NOT NULL,
164     hostid integer NOT NULL,
165     name text,
166     name_deleted text,
167     image bytea NOT NULL,
168     width integer NOT NULL,
169     height integer NOT NULL,
170     alt text NOT NULL,
171     title text,
172     longdesc text,
173     "class" text,
174     mime_type text NOT NULL,
175     thumbnail bytea,
176     tn_width integer,
177     tn_height integer,
178     tn_mime_type text,
179     upload_date timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL
180 );
181
182
183 --
184 -- TOC entry 21 (OID 537151)
185 -- Name: images; Type: ACL; Schema: public; Owner: rich
186 --
187
188 REVOKE ALL ON TABLE images FROM PUBLIC;
189 GRANT ALL ON TABLE images TO "www-data";
190
191
192 --
193 -- TOC entry 68 (OID 537151)
194 -- Name: images_id_seq; Type: ACL; Schema: public; Owner: rich
195 --
196
197 REVOKE ALL ON TABLE images_id_seq FROM PUBLIC;
198 GRANT ALL ON TABLE images_id_seq TO "www-data";
199
200
201 --
202 -- TOC entry 22 (OID 537166)
203 -- Name: files; Type: TABLE; Schema: public; Owner: rich
204 --
205
206 CREATE TABLE files (
207     id serial NOT NULL,
208     hostid integer NOT NULL,
209     name text,
210     name_deleted text,
211     content bytea NOT NULL,
212     title text,
213     mime_type text NOT NULL,
214     upload_date timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL
215 );
216
217
218 --
219 -- TOC entry 23 (OID 537166)
220 -- Name: files; Type: ACL; Schema: public; Owner: rich
221 --
222
223 REVOKE ALL ON TABLE files FROM PUBLIC;
224 GRANT ALL ON TABLE files TO "www-data";
225
226
227 --
228 -- TOC entry 69 (OID 537166)
229 -- Name: files_id_seq; Type: ACL; Schema: public; Owner: rich
230 --
231
232 REVOKE ALL ON TABLE files_id_seq FROM PUBLIC;
233 GRANT ALL ON TABLE files_id_seq TO "www-data";
234
235
236 --
237 -- TOC entry 24 (OID 540816)
238 -- Name: users; Type: TABLE; Schema: public; Owner: rich
239 --
240
241 CREATE TABLE users (
242     id serial NOT NULL,
243     hostid integer NOT NULL,
244     name text NOT NULL,
245     "password" text NOT NULL,
246     email text,
247     registration_date date DEFAULT ('now'::text)::date NOT NULL,
248     can_edit boolean DEFAULT true NOT NULL,
249     can_manage_users boolean DEFAULT false NOT NULL,
250     can_manage_contacts boolean DEFAULT false NOT NULL,
251     can_manage_site boolean DEFAULT false NOT NULL,
252     can_edit_global_css boolean DEFAULT false NOT NULL,
253     force_password_change boolean DEFAULT false NOT NULL,
254     can_import_mail boolean DEFAULT false NOT NULL,
255     email_notify boolean DEFAULT true NOT NULL,
256     invite text
257 );
258
259
260 --
261 -- TOC entry 25 (OID 540816)
262 -- Name: users; Type: ACL; Schema: public; Owner: rich
263 --
264
265 REVOKE ALL ON TABLE users FROM PUBLIC;
266 GRANT ALL ON TABLE users TO "www-data";
267
268
269 --
270 -- TOC entry 70 (OID 540816)
271 -- Name: users_id_seq; Type: ACL; Schema: public; Owner: rich
272 --
273
274 REVOKE ALL ON TABLE users_id_seq FROM PUBLIC;
275 GRANT ALL ON TABLE users_id_seq TO "www-data";
276
277
278 --
279 -- TOC entry 26 (OID 540832)
280 -- Name: usercookies; Type: TABLE; Schema: public; Owner: rich
281 --
282
283 CREATE TABLE usercookies (
284     userid integer NOT NULL,
285     cookie text NOT NULL
286 );
287
288
289 --
290 -- TOC entry 27 (OID 540832)
291 -- Name: usercookies; Type: ACL; Schema: public; Owner: rich
292 --
293
294 REVOKE ALL ON TABLE usercookies FROM PUBLIC;
295 GRANT ALL ON TABLE usercookies TO "www-data";
296
297
298 --
299 -- TOC entry 28 (OID 540961)
300 -- Name: sitemenu; Type: TABLE; Schema: public; Owner: rich
301 --
302
303 CREATE TABLE sitemenu (
304     hostid integer NOT NULL,
305     url text NOT NULL,
306     label text NOT NULL,
307     ordering integer NOT NULL
308 );
309
310
311 --
312 -- TOC entry 29 (OID 540961)
313 -- Name: sitemenu; Type: ACL; Schema: public; Owner: rich
314 --
315
316 REVOKE ALL ON TABLE sitemenu FROM PUBLIC;
317 GRANT ALL ON TABLE sitemenu TO "www-data";
318
319
320 --
321 -- TOC entry 30 (OID 542605)
322 -- Name: contacts; Type: TABLE; Schema: public; Owner: rich
323 --
324
325 CREATE TABLE contacts (
326     id serial NOT NULL,
327     hostid integer NOT NULL,
328     name text NOT NULL,
329     subject text NOT NULL
330 );
331
332
333 --
334 -- TOC entry 31 (OID 542605)
335 -- Name: contacts; Type: ACL; Schema: public; Owner: rich
336 --
337
338 REVOKE ALL ON TABLE contacts FROM PUBLIC;
339 GRANT ALL ON TABLE contacts TO "www-data";
340
341
342 --
343 -- TOC entry 71 (OID 542605)
344 -- Name: contacts_id_seq; Type: ACL; Schema: public; Owner: rich
345 --
346
347 REVOKE ALL ON TABLE contacts_id_seq FROM PUBLIC;
348 GRANT ALL ON TABLE contacts_id_seq TO "www-data";
349
350
351 --
352 -- TOC entry 32 (OID 542617)
353 -- Name: contact_emails; Type: TABLE; Schema: public; Owner: rich
354 --
355
356 CREATE TABLE contact_emails (
357     contactid integer NOT NULL,
358     email text NOT NULL
359 );
360
361
362 --
363 -- TOC entry 33 (OID 542617)
364 -- Name: contact_emails; Type: ACL; Schema: public; Owner: rich
365 --
366
367 REVOKE ALL ON TABLE contact_emails FROM PUBLIC;
368 GRANT ALL ON TABLE contact_emails TO "www-data";
369
370
371 --
372 -- TOC entry 34 (OID 543499)
373 -- Name: themes; Type: TABLE; Schema: public; Owner: rich
374 --
375
376 CREATE TABLE themes (
377     theme_css text NOT NULL,
378     name text NOT NULL,
379     description text NOT NULL
380 );
381
382
383 --
384 -- TOC entry 35 (OID 543499)
385 -- Name: themes; Type: ACL; Schema: public; Owner: rich
386 --
387
388 REVOKE ALL ON TABLE themes FROM PUBLIC;
389 GRANT SELECT ON TABLE themes TO "www-data";
390
391
392 --
393 -- TOC entry 36 (OID 543592)
394 -- Name: server_settings; Type: TABLE; Schema: public; Owner: rich
395 --
396
397 CREATE TABLE server_settings (
398     "version" integer NOT NULL,
399     stats_page text,
400     crash_email text
401 );
402
403
404 --
405 -- TOC entry 38 (OID 543592)
406 -- Name: server_settings; Type: ACL; Schema: public; Owner: rich
407 --
408
409 REVOKE ALL ON TABLE server_settings FROM PUBLIC;
410 GRANT SELECT ON TABLE server_settings TO "www-data";
411
412
413 --
414 -- TOC entry 39 (OID 543754)
415 -- Name: page_emails; Type: TABLE; Schema: public; Owner: rich
416 --
417
418 CREATE TABLE page_emails (
419     hostid integer NOT NULL,
420     url text NOT NULL,
421     email text NOT NULL,
422     entry_date date DEFAULT ('now'::text)::date NOT NULL,
423     last_sent date DEFAULT ('now'::text)::date NOT NULL,
424     pending text,
425     opt_out text NOT NULL
426 );
427
428
429 --
430 -- TOC entry 40 (OID 543754)
431 -- Name: page_emails; Type: ACL; Schema: public; Owner: rich
432 --
433
434 REVOKE ALL ON TABLE page_emails FROM PUBLIC;
435 GRANT ALL ON TABLE page_emails TO "www-data";
436
437
438 --
439 -- TOC entry 41 (OID 543785)
440 -- Name: mailing_lists; Type: TABLE; Schema: public; Owner: rich
441 --
442
443 CREATE TABLE mailing_lists (
444     hostid integer NOT NULL,
445     email text NOT NULL,
446     entry_date date DEFAULT ('now'::text)::date NOT NULL,
447     pending text,
448     opt_out text NOT NULL,
449     name text NOT NULL
450 );
451
452
453 --
454 -- TOC entry 42 (OID 543785)
455 -- Name: mailing_lists; Type: ACL; Schema: public; Owner: rich
456 --
457
458 REVOKE ALL ON TABLE mailing_lists FROM PUBLIC;
459 GRANT ALL ON TABLE mailing_lists TO "www-data";
460
461
462 --
463 -- TOC entry 43 (OID 544445)
464 -- Name: links; Type: TABLE; Schema: public; Owner: rich
465 --
466
467 CREATE TABLE links (
468     hostid integer NOT NULL,
469     from_url text NOT NULL,
470     to_url text NOT NULL,
471     CONSTRAINT links_not_selfref_cn CHECK ((from_url <> to_url))
472 );
473
474
475 --
476 -- TOC entry 44 (OID 544445)
477 -- Name: links; Type: ACL; Schema: public; Owner: rich
478 --
479
480 REVOKE ALL ON TABLE links FROM PUBLIC;
481 GRANT ALL ON TABLE links TO "www-data";
482
483
484 --
485 -- TOC entry 45 (OID 547939)
486 -- Name: templates; Type: TABLE; Schema: public; Owner: rich
487 --
488
489 CREATE TABLE templates (
490     id serial NOT NULL,
491     title_regexp text NOT NULL,
492     url_regexp text NOT NULL,
493     extension text NOT NULL,
494     ordering integer NOT NULL
495 );
496
497
498 --
499 -- TOC entry 46 (OID 547939)
500 -- Name: templates; Type: ACL; Schema: public; Owner: rich
501 --
502
503 REVOKE ALL ON TABLE templates FROM PUBLIC;
504 GRANT SELECT ON TABLE templates TO "www-data";
505
506
507 --
508 -- TOC entry 72 (OID 547939)
509 -- Name: templates_id_seq; Type: ACL; Schema: public; Owner: rich
510 --
511
512 REVOKE ALL ON TABLE templates_id_seq FROM PUBLIC;
513
514
515 --
516 -- TOC entry 47 (OID 551123)
517 -- Name: recently_visited; Type: TABLE; Schema: public; Owner: rich
518 --
519
520 CREATE TABLE recently_visited (
521     userid integer NOT NULL,
522     hostid integer NOT NULL,
523     url text NOT NULL,
524     visit_time timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL
525 );
526
527
528 --
529 -- TOC entry 48 (OID 551123)
530 -- Name: recently_visited; Type: ACL; Schema: public; Owner: rich
531 --
532
533 REVOKE ALL ON TABLE recently_visited FROM PUBLIC;
534 GRANT ALL ON TABLE recently_visited TO "www-data";
535
536
537 --
538 -- TOC entry 49 (OID 551675)
539 -- Name: messages; Type: TABLE; Schema: public; Owner: rich
540 --
541
542 CREATE TABLE messages (
543     id serial NOT NULL,
544     subject text NOT NULL,
545     inet_message_id text NOT NULL,
546     message_date timestamp with time zone NOT NULL,
547     hostid integer NOT NULL
548 );
549
550
551 --
552 -- TOC entry 50 (OID 551675)
553 -- Name: messages; Type: ACL; Schema: public; Owner: rich
554 --
555
556 REVOKE ALL ON TABLE messages FROM PUBLIC;
557 GRANT ALL ON TABLE messages TO "www-data";
558
559
560 --
561 -- TOC entry 73 (OID 551675)
562 -- Name: messages_id_seq; Type: ACL; Schema: public; Owner: rich
563 --
564
565 REVOKE ALL ON TABLE messages_id_seq FROM PUBLIC;
566 GRANT ALL ON TABLE messages_id_seq TO "www-data";
567
568
569 --
570 -- TOC entry 51 (OID 551685)
571 -- Name: msg_references; Type: TABLE; Schema: public; Owner: rich
572 --
573
574 CREATE TABLE msg_references (
575     message_id integer NOT NULL,
576     inet_message_id text NOT NULL,
577     ordering integer NOT NULL
578 );
579
580
581 --
582 -- TOC entry 52 (OID 551685)
583 -- Name: msg_references; Type: ACL; Schema: public; Owner: rich
584 --
585
586 REVOKE ALL ON TABLE msg_references FROM PUBLIC;
587 GRANT ALL ON TABLE msg_references TO "www-data";
588
589
590 --
591 -- TOC entry 53 (OID 607075)
592 -- Name: powered_by; Type: TABLE; Schema: public; Owner: rich
593 --
594
595 CREATE TABLE powered_by (
596     id serial NOT NULL,
597     name text NOT NULL,
598     url text NOT NULL
599 );
600
601
602 --
603 -- TOC entry 54 (OID 607075)
604 -- Name: powered_by; Type: ACL; Schema: public; Owner: rich
605 --
606
607 REVOKE ALL ON TABLE powered_by FROM PUBLIC;
608 GRANT SELECT ON TABLE powered_by TO "www-data";
609
610
611 --
612 -- TOC entry 55 (OID 607136)
613 -- Name: pending_email_changes; Type: TABLE; Schema: public; Owner: rich
614 --
615
616 CREATE TABLE pending_email_changes (
617     "key" text NOT NULL,
618     change_date date DEFAULT ('now'::text)::date NOT NULL,
619     userid integer NOT NULL,
620     email text NOT NULL
621 );
622
623
624 --
625 -- TOC entry 56 (OID 607136)
626 -- Name: pending_email_changes; Type: ACL; Schema: public; Owner: rich
627 --
628
629 REVOKE ALL ON TABLE pending_email_changes FROM PUBLIC;
630 GRANT ALL ON TABLE pending_email_changes TO "www-data";
631
632
633 --
634 -- TOC entry 57 (OID 618606)
635 -- Name: pg_ts_dict; Type: TABLE; Schema: public; Owner: postgres
636 --
637
638 CREATE TABLE pg_ts_dict (
639     dict_name text NOT NULL,
640     dict_init regprocedure,
641     dict_initoption text,
642     dict_lexize regprocedure NOT NULL,
643     dict_comment text
644 );
645
646
647 --
648 -- TOC entry 58 (OID 618606)
649 -- Name: pg_ts_dict; Type: ACL; Schema: public; Owner: postgres
650 --
651
652 REVOKE ALL ON TABLE pg_ts_dict FROM PUBLIC;
653 GRANT SELECT ON TABLE pg_ts_dict TO rich;
654 GRANT SELECT ON TABLE pg_ts_dict TO "www-data";
655
656
657 --
658 -- TOC entry 116 (OID 618613)
659 -- Name: lexize(oid, text); Type: FUNCTION; Schema: public; Owner: postgres
660 --
661
662 CREATE FUNCTION lexize(oid, text) RETURNS text[]
663     AS '$libdir/tsearch2', 'lexize'
664     LANGUAGE c STRICT;
665
666
667 --
668 -- TOC entry 117 (OID 618614)
669 -- Name: lexize(text, text); Type: FUNCTION; Schema: public; Owner: postgres
670 --
671
672 CREATE FUNCTION lexize(text, text) RETURNS text[]
673     AS '$libdir/tsearch2', 'lexize_byname'
674     LANGUAGE c STRICT;
675
676
677 --
678 -- TOC entry 118 (OID 618615)
679 -- Name: lexize(text); Type: FUNCTION; Schema: public; Owner: postgres
680 --
681
682 CREATE FUNCTION lexize(text) RETURNS text[]
683     AS '$libdir/tsearch2', 'lexize_bycurrent'
684     LANGUAGE c STRICT;
685
686
687 --
688 -- TOC entry 119 (OID 618616)
689 -- Name: set_curdict(integer); Type: FUNCTION; Schema: public; Owner: postgres
690 --
691
692 CREATE FUNCTION set_curdict(integer) RETURNS void
693     AS '$libdir/tsearch2', 'set_curdict'
694     LANGUAGE c STRICT;
695
696
697 --
698 -- TOC entry 120 (OID 618617)
699 -- Name: set_curdict(text); Type: FUNCTION; Schema: public; Owner: postgres
700 --
701
702 CREATE FUNCTION set_curdict(text) RETURNS void
703     AS '$libdir/tsearch2', 'set_curdict_byname'
704     LANGUAGE c STRICT;
705
706
707 --
708 -- TOC entry 121 (OID 618618)
709 -- Name: dex_init(text); Type: FUNCTION; Schema: public; Owner: postgres
710 --
711
712 CREATE FUNCTION dex_init(text) RETURNS internal
713     AS '$libdir/tsearch2', 'dex_init'
714     LANGUAGE c;
715
716
717 --
718 -- TOC entry 122 (OID 618619)
719 -- Name: dex_lexize(internal, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
720 --
721
722 CREATE FUNCTION dex_lexize(internal, internal, integer) RETURNS internal
723     AS '$libdir/tsearch2', 'dex_lexize'
724     LANGUAGE c STRICT;
725
726
727 --
728 -- TOC entry 123 (OID 618621)
729 -- Name: snb_en_init(text); Type: FUNCTION; Schema: public; Owner: postgres
730 --
731
732 CREATE FUNCTION snb_en_init(text) RETURNS internal
733     AS '$libdir/tsearch2', 'snb_en_init'
734     LANGUAGE c;
735
736
737 --
738 -- TOC entry 124 (OID 618622)
739 -- Name: snb_lexize(internal, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
740 --
741
742 CREATE FUNCTION snb_lexize(internal, internal, integer) RETURNS internal
743     AS '$libdir/tsearch2', 'snb_lexize'
744     LANGUAGE c STRICT;
745
746
747 --
748 -- TOC entry 125 (OID 618624)
749 -- Name: snb_ru_init(text); Type: FUNCTION; Schema: public; Owner: postgres
750 --
751
752 CREATE FUNCTION snb_ru_init(text) RETURNS internal
753     AS '$libdir/tsearch2', 'snb_ru_init'
754     LANGUAGE c;
755
756
757 --
758 -- TOC entry 126 (OID 618626)
759 -- Name: spell_init(text); Type: FUNCTION; Schema: public; Owner: postgres
760 --
761
762 CREATE FUNCTION spell_init(text) RETURNS internal
763     AS '$libdir/tsearch2', 'spell_init'
764     LANGUAGE c;
765
766
767 --
768 -- TOC entry 127 (OID 618627)
769 -- Name: spell_lexize(internal, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
770 --
771
772 CREATE FUNCTION spell_lexize(internal, internal, integer) RETURNS internal
773     AS '$libdir/tsearch2', 'spell_lexize'
774     LANGUAGE c STRICT;
775
776
777 --
778 -- TOC entry 128 (OID 618629)
779 -- Name: syn_init(text); Type: FUNCTION; Schema: public; Owner: postgres
780 --
781
782 CREATE FUNCTION syn_init(text) RETURNS internal
783     AS '$libdir/tsearch2', 'syn_init'
784     LANGUAGE c;
785
786
787 --
788 -- TOC entry 129 (OID 618630)
789 -- Name: syn_lexize(internal, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
790 --
791
792 CREATE FUNCTION syn_lexize(internal, internal, integer) RETURNS internal
793     AS '$libdir/tsearch2', 'syn_lexize'
794     LANGUAGE c STRICT;
795
796
797 --
798 -- TOC entry 59 (OID 618632)
799 -- Name: pg_ts_parser; Type: TABLE; Schema: public; Owner: postgres
800 --
801
802 CREATE TABLE pg_ts_parser (
803     prs_name text NOT NULL,
804     prs_start regprocedure NOT NULL,
805     prs_nexttoken regprocedure NOT NULL,
806     prs_end regprocedure NOT NULL,
807     prs_headline regprocedure NOT NULL,
808     prs_lextype regprocedure NOT NULL,
809     prs_comment text
810 );
811
812
813 --
814 -- TOC entry 60 (OID 618632)
815 -- Name: pg_ts_parser; Type: ACL; Schema: public; Owner: postgres
816 --
817
818 REVOKE ALL ON TABLE pg_ts_parser FROM PUBLIC;
819 GRANT SELECT ON TABLE pg_ts_parser TO rich;
820 GRANT SELECT ON TABLE pg_ts_parser TO "www-data";
821
822
823 --
824 -- TOC entry 5 (OID 618640)
825 -- Name: tokentype; Type: TYPE; Schema: public; Owner: postgres
826 --
827
828 CREATE TYPE tokentype AS (
829         tokid integer,
830         alias text,
831         descr text
832 );
833
834
835 --
836 -- TOC entry 130 (OID 618641)
837 -- Name: token_type(integer); Type: FUNCTION; Schema: public; Owner: postgres
838 --
839
840 CREATE FUNCTION token_type(integer) RETURNS SETOF tokentype
841     AS '$libdir/tsearch2', 'token_type'
842     LANGUAGE c STRICT;
843
844
845 --
846 -- TOC entry 131 (OID 618642)
847 -- Name: token_type(text); Type: FUNCTION; Schema: public; Owner: postgres
848 --
849
850 CREATE FUNCTION token_type(text) RETURNS SETOF tokentype
851     AS '$libdir/tsearch2', 'token_type_byname'
852     LANGUAGE c STRICT;
853
854
855 --
856 -- TOC entry 132 (OID 618643)
857 -- Name: token_type(); Type: FUNCTION; Schema: public; Owner: postgres
858 --
859
860 CREATE FUNCTION token_type() RETURNS SETOF tokentype
861     AS '$libdir/tsearch2', 'token_type_current'
862     LANGUAGE c STRICT;
863
864
865 --
866 -- TOC entry 133 (OID 618644)
867 -- Name: set_curprs(integer); Type: FUNCTION; Schema: public; Owner: postgres
868 --
869
870 CREATE FUNCTION set_curprs(integer) RETURNS void
871     AS '$libdir/tsearch2', 'set_curprs'
872     LANGUAGE c STRICT;
873
874
875 --
876 -- TOC entry 134 (OID 618645)
877 -- Name: set_curprs(text); Type: FUNCTION; Schema: public; Owner: postgres
878 --
879
880 CREATE FUNCTION set_curprs(text) RETURNS void
881     AS '$libdir/tsearch2', 'set_curprs_byname'
882     LANGUAGE c STRICT;
883
884
885 --
886 -- TOC entry 6 (OID 618647)
887 -- Name: tokenout; Type: TYPE; Schema: public; Owner: postgres
888 --
889
890 CREATE TYPE tokenout AS (
891         tokid integer,
892         token text
893 );
894
895
896 --
897 -- TOC entry 135 (OID 618648)
898 -- Name: parse(oid, text); Type: FUNCTION; Schema: public; Owner: postgres
899 --
900
901 CREATE FUNCTION parse(oid, text) RETURNS SETOF tokenout
902     AS '$libdir/tsearch2', 'parse'
903     LANGUAGE c STRICT;
904
905
906 --
907 -- TOC entry 136 (OID 618649)
908 -- Name: parse(text, text); Type: FUNCTION; Schema: public; Owner: postgres
909 --
910
911 CREATE FUNCTION parse(text, text) RETURNS SETOF tokenout
912     AS '$libdir/tsearch2', 'parse_byname'
913     LANGUAGE c STRICT;
914
915
916 --
917 -- TOC entry 137 (OID 618650)
918 -- Name: parse(text); Type: FUNCTION; Schema: public; Owner: postgres
919 --
920
921 CREATE FUNCTION parse(text) RETURNS SETOF tokenout
922     AS '$libdir/tsearch2', 'parse_current'
923     LANGUAGE c STRICT;
924
925
926 --
927 -- TOC entry 138 (OID 618651)
928 -- Name: prsd_start(internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
929 --
930
931 CREATE FUNCTION prsd_start(internal, integer) RETURNS internal
932     AS '$libdir/tsearch2', 'prsd_start'
933     LANGUAGE c;
934
935
936 --
937 -- TOC entry 139 (OID 618652)
938 -- Name: prsd_getlexeme(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
939 --
940
941 CREATE FUNCTION prsd_getlexeme(internal, internal, internal) RETURNS integer
942     AS '$libdir/tsearch2', 'prsd_getlexeme'
943     LANGUAGE c;
944
945
946 --
947 -- TOC entry 140 (OID 618653)
948 -- Name: prsd_end(internal); Type: FUNCTION; Schema: public; Owner: postgres
949 --
950
951 CREATE FUNCTION prsd_end(internal) RETURNS void
952     AS '$libdir/tsearch2', 'prsd_end'
953     LANGUAGE c;
954
955
956 --
957 -- TOC entry 141 (OID 618654)
958 -- Name: prsd_lextype(internal); Type: FUNCTION; Schema: public; Owner: postgres
959 --
960
961 CREATE FUNCTION prsd_lextype(internal) RETURNS internal
962     AS '$libdir/tsearch2', 'prsd_lextype'
963     LANGUAGE c;
964
965
966 --
967 -- TOC entry 142 (OID 618655)
968 -- Name: prsd_headline(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
969 --
970
971 CREATE FUNCTION prsd_headline(internal, internal, internal) RETURNS internal
972     AS '$libdir/tsearch2', 'prsd_headline'
973     LANGUAGE c;
974
975
976 --
977 -- TOC entry 61 (OID 618657)
978 -- Name: pg_ts_cfg; Type: TABLE; Schema: public; Owner: postgres
979 --
980
981 CREATE TABLE pg_ts_cfg (
982     ts_name text NOT NULL,
983     prs_name text NOT NULL,
984     locale text
985 );
986
987
988 --
989 -- TOC entry 62 (OID 618657)
990 -- Name: pg_ts_cfg; Type: ACL; Schema: public; Owner: postgres
991 --
992
993 REVOKE ALL ON TABLE pg_ts_cfg FROM PUBLIC;
994 GRANT SELECT ON TABLE pg_ts_cfg TO rich;
995 GRANT SELECT ON TABLE pg_ts_cfg TO "www-data";
996
997
998 --
999 -- TOC entry 63 (OID 618664)
1000 -- Name: pg_ts_cfgmap; Type: TABLE; Schema: public; Owner: postgres
1001 --
1002
1003 CREATE TABLE pg_ts_cfgmap (
1004     ts_name text NOT NULL,
1005     tok_alias text NOT NULL,
1006     dict_name text[]
1007 );
1008
1009
1010 --
1011 -- TOC entry 64 (OID 618664)
1012 -- Name: pg_ts_cfgmap; Type: ACL; Schema: public; Owner: postgres
1013 --
1014
1015 REVOKE ALL ON TABLE pg_ts_cfgmap FROM PUBLIC;
1016 GRANT SELECT ON TABLE pg_ts_cfgmap TO rich;
1017 GRANT SELECT ON TABLE pg_ts_cfgmap TO "www-data";
1018
1019
1020 --
1021 -- TOC entry 143 (OID 618671)
1022 -- Name: set_curcfg(integer); Type: FUNCTION; Schema: public; Owner: postgres
1023 --
1024
1025 CREATE FUNCTION set_curcfg(integer) RETURNS void
1026     AS '$libdir/tsearch2', 'set_curcfg'
1027     LANGUAGE c STRICT;
1028
1029
1030 --
1031 -- TOC entry 144 (OID 618672)
1032 -- Name: set_curcfg(text); Type: FUNCTION; Schema: public; Owner: postgres
1033 --
1034
1035 CREATE FUNCTION set_curcfg(text) RETURNS void
1036     AS '$libdir/tsearch2', 'set_curcfg_byname'
1037     LANGUAGE c STRICT;
1038
1039
1040 --
1041 -- TOC entry 145 (OID 618673)
1042 -- Name: show_curcfg(); Type: FUNCTION; Schema: public; Owner: postgres
1043 --
1044
1045 CREATE FUNCTION show_curcfg() RETURNS oid
1046     AS '$libdir/tsearch2', 'show_curcfg'
1047     LANGUAGE c STRICT;
1048
1049
1050 --
1051 -- TOC entry 146 (OID 618735)
1052 -- Name: tsvector_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
1053 --
1054
1055 CREATE FUNCTION tsvector_in(cstring) RETURNS tsvector
1056     AS '$libdir/tsearch2', 'tsvector_in'
1057     LANGUAGE c STRICT;
1058
1059
1060 --
1061 -- TOC entry 147 (OID 618736)
1062 -- Name: tsvector_out(tsvector); Type: FUNCTION; Schema: public; Owner: postgres
1063 --
1064
1065 CREATE FUNCTION tsvector_out(tsvector) RETURNS cstring
1066     AS '$libdir/tsearch2', 'tsvector_out'
1067     LANGUAGE c STRICT;
1068
1069
1070 --
1071 -- TOC entry 7 (OID 618734)
1072 -- Name: tsvector; Type: TYPE; Schema: public; Owner: postgres
1073 --
1074
1075 CREATE TYPE tsvector (
1076     INTERNALLENGTH = variable,
1077     INPUT = tsvector_in,
1078     OUTPUT = tsvector_out,
1079     ALIGNMENT = int4,
1080     STORAGE = extended
1081 );
1082
1083
1084 --
1085 -- TOC entry 148 (OID 618738)
1086 -- Name: length(tsvector); Type: FUNCTION; Schema: public; Owner: postgres
1087 --
1088
1089 CREATE FUNCTION length(tsvector) RETURNS integer
1090     AS '$libdir/tsearch2', 'tsvector_length'
1091     LANGUAGE c IMMUTABLE STRICT;
1092
1093
1094 --
1095 -- TOC entry 149 (OID 618739)
1096 -- Name: to_tsvector(oid, text); Type: FUNCTION; Schema: public; Owner: postgres
1097 --
1098
1099 CREATE FUNCTION to_tsvector(oid, text) RETURNS tsvector
1100     AS '$libdir/tsearch2', 'to_tsvector'
1101     LANGUAGE c IMMUTABLE STRICT;
1102
1103
1104 --
1105 -- TOC entry 150 (OID 618740)
1106 -- Name: to_tsvector(text, text); Type: FUNCTION; Schema: public; Owner: postgres
1107 --
1108
1109 CREATE FUNCTION to_tsvector(text, text) RETURNS tsvector
1110     AS '$libdir/tsearch2', 'to_tsvector_name'
1111     LANGUAGE c IMMUTABLE STRICT;
1112
1113
1114 --
1115 -- TOC entry 151 (OID 618741)
1116 -- Name: to_tsvector(text); Type: FUNCTION; Schema: public; Owner: postgres
1117 --
1118
1119 CREATE FUNCTION to_tsvector(text) RETURNS tsvector
1120     AS '$libdir/tsearch2', 'to_tsvector_current'
1121     LANGUAGE c IMMUTABLE STRICT;
1122
1123
1124 --
1125 -- TOC entry 152 (OID 618742)
1126 -- Name: strip(tsvector); Type: FUNCTION; Schema: public; Owner: postgres
1127 --
1128
1129 CREATE FUNCTION strip(tsvector) RETURNS tsvector
1130     AS '$libdir/tsearch2', 'strip'
1131     LANGUAGE c IMMUTABLE STRICT;
1132
1133
1134 --
1135 -- TOC entry 153 (OID 618743)
1136 -- Name: setweight(tsvector, "char"); Type: FUNCTION; Schema: public; Owner: postgres
1137 --
1138
1139 CREATE FUNCTION setweight(tsvector, "char") RETURNS tsvector
1140     AS '$libdir/tsearch2', 'setweight'
1141     LANGUAGE c IMMUTABLE STRICT;
1142
1143
1144 --
1145 -- TOC entry 154 (OID 618744)
1146 -- Name: concat(tsvector, tsvector); Type: FUNCTION; Schema: public; Owner: postgres
1147 --
1148
1149 CREATE FUNCTION concat(tsvector, tsvector) RETURNS tsvector
1150     AS '$libdir/tsearch2', 'concat'
1151     LANGUAGE c IMMUTABLE STRICT;
1152
1153
1154 --
1155 -- TOC entry 194 (OID 618745)
1156 -- Name: ||; Type: OPERATOR; Schema: public; Owner: postgres
1157 --
1158
1159 CREATE OPERATOR || (
1160     PROCEDURE = concat,
1161     LEFTARG = tsvector,
1162     RIGHTARG = tsvector
1163 );
1164
1165
1166 --
1167 -- TOC entry 155 (OID 618747)
1168 -- Name: tsquery_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
1169 --
1170
1171 CREATE FUNCTION tsquery_in(cstring) RETURNS tsquery
1172     AS '$libdir/tsearch2', 'tsquery_in'
1173     LANGUAGE c STRICT;
1174
1175
1176 --
1177 -- TOC entry 156 (OID 618748)
1178 -- Name: tsquery_out(tsquery); Type: FUNCTION; Schema: public; Owner: postgres
1179 --
1180
1181 CREATE FUNCTION tsquery_out(tsquery) RETURNS cstring
1182     AS '$libdir/tsearch2', 'tsquery_out'
1183     LANGUAGE c STRICT;
1184
1185
1186 --
1187 -- TOC entry 8 (OID 618746)
1188 -- Name: tsquery; Type: TYPE; Schema: public; Owner: postgres
1189 --
1190
1191 CREATE TYPE tsquery (
1192     INTERNALLENGTH = variable,
1193     INPUT = tsquery_in,
1194     OUTPUT = tsquery_out,
1195     ALIGNMENT = int4,
1196     STORAGE = plain
1197 );
1198
1199
1200 --
1201 -- TOC entry 157 (OID 618750)
1202 -- Name: querytree(tsquery); Type: FUNCTION; Schema: public; Owner: postgres
1203 --
1204
1205 CREATE FUNCTION querytree(tsquery) RETURNS text
1206     AS '$libdir/tsearch2', 'tsquerytree'
1207     LANGUAGE c STRICT;
1208
1209
1210 --
1211 -- TOC entry 158 (OID 618751)
1212 -- Name: to_tsquery(oid, text); Type: FUNCTION; Schema: public; Owner: postgres
1213 --
1214
1215 CREATE FUNCTION to_tsquery(oid, text) RETURNS tsquery
1216     AS '$libdir/tsearch2', 'to_tsquery'
1217     LANGUAGE c IMMUTABLE STRICT;
1218
1219
1220 --
1221 -- TOC entry 159 (OID 618752)
1222 -- Name: to_tsquery(text, text); Type: FUNCTION; Schema: public; Owner: postgres
1223 --
1224
1225 CREATE FUNCTION to_tsquery(text, text) RETURNS tsquery
1226     AS '$libdir/tsearch2', 'to_tsquery_name'
1227     LANGUAGE c IMMUTABLE STRICT;
1228
1229
1230 --
1231 -- TOC entry 160 (OID 618753)
1232 -- Name: to_tsquery(text); Type: FUNCTION; Schema: public; Owner: postgres
1233 --
1234
1235 CREATE FUNCTION to_tsquery(text) RETURNS tsquery
1236     AS '$libdir/tsearch2', 'to_tsquery_current'
1237     LANGUAGE c IMMUTABLE STRICT;
1238
1239
1240 --
1241 -- TOC entry 161 (OID 618754)
1242 -- Name: exectsq(tsvector, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
1243 --
1244
1245 CREATE FUNCTION exectsq(tsvector, tsquery) RETURNS boolean
1246     AS '$libdir/tsearch2', 'exectsq'
1247     LANGUAGE c IMMUTABLE STRICT;
1248
1249
1250 --
1251 -- TOC entry 163 (OID 618755)
1252 -- Name: rexectsq(tsquery, tsvector); Type: FUNCTION; Schema: public; Owner: postgres
1253 --
1254
1255 CREATE FUNCTION rexectsq(tsquery, tsvector) RETURNS boolean
1256     AS '$libdir/tsearch2', 'rexectsq'
1257     LANGUAGE c IMMUTABLE STRICT;
1258
1259
1260 --
1261 -- TOC entry 196 (OID 618756)
1262 -- Name: @@; Type: OPERATOR; Schema: public; Owner: postgres
1263 --
1264
1265 CREATE OPERATOR @@ (
1266     PROCEDURE = rexectsq,
1267     LEFTARG = tsquery,
1268     RIGHTARG = tsvector,
1269     COMMUTATOR = @@,
1270     RESTRICT = contsel,
1271     JOIN = contjoinsel
1272 );
1273
1274
1275 --
1276 -- TOC entry 195 (OID 618757)
1277 -- Name: @@; Type: OPERATOR; Schema: public; Owner: postgres
1278 --
1279
1280 CREATE OPERATOR @@ (
1281     PROCEDURE = exectsq,
1282     LEFTARG = tsvector,
1283     RIGHTARG = tsquery,
1284     COMMUTATOR = @@,
1285     RESTRICT = contsel,
1286     JOIN = contjoinsel
1287 );
1288
1289
1290 --
1291 -- TOC entry 165 (OID 618758)
1292 -- Name: tsearch2(); Type: FUNCTION; Schema: public; Owner: postgres
1293 --
1294
1295 CREATE FUNCTION tsearch2() RETURNS "trigger"
1296     AS '$libdir/tsearch2', 'tsearch2'
1297     LANGUAGE c;
1298
1299
1300 --
1301 -- TOC entry 166 (OID 618759)
1302 -- Name: rank(real[], tsvector, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
1303 --
1304
1305 CREATE FUNCTION rank(real[], tsvector, tsquery) RETURNS real
1306     AS '$libdir/tsearch2', 'rank'
1307     LANGUAGE c IMMUTABLE STRICT;
1308
1309
1310 --
1311 -- TOC entry 167 (OID 618760)
1312 -- Name: rank(real[], tsvector, tsquery, integer); Type: FUNCTION; Schema: public; Owner: postgres
1313 --
1314
1315 CREATE FUNCTION rank(real[], tsvector, tsquery, integer) RETURNS real
1316     AS '$libdir/tsearch2', 'rank'
1317     LANGUAGE c IMMUTABLE STRICT;
1318
1319
1320 --
1321 -- TOC entry 168 (OID 618761)
1322 -- Name: rank(tsvector, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
1323 --
1324
1325 CREATE FUNCTION rank(tsvector, tsquery) RETURNS real
1326     AS '$libdir/tsearch2', 'rank_def'
1327     LANGUAGE c IMMUTABLE STRICT;
1328
1329
1330 --
1331 -- TOC entry 169 (OID 618762)
1332 -- Name: rank(tsvector, tsquery, integer); Type: FUNCTION; Schema: public; Owner: postgres
1333 --
1334
1335 CREATE FUNCTION rank(tsvector, tsquery, integer) RETURNS real
1336     AS '$libdir/tsearch2', 'rank_def'
1337     LANGUAGE c IMMUTABLE STRICT;
1338
1339
1340 --
1341 -- TOC entry 170 (OID 618763)
1342 -- Name: rank_cd(integer, tsvector, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
1343 --
1344
1345 CREATE FUNCTION rank_cd(integer, tsvector, tsquery) RETURNS real
1346     AS '$libdir/tsearch2', 'rank_cd'
1347     LANGUAGE c IMMUTABLE STRICT;
1348
1349
1350 --
1351 -- TOC entry 171 (OID 618764)
1352 -- Name: rank_cd(integer, tsvector, tsquery, integer); Type: FUNCTION; Schema: public; Owner: postgres
1353 --
1354
1355 CREATE FUNCTION rank_cd(integer, tsvector, tsquery, integer) RETURNS real
1356     AS '$libdir/tsearch2', 'rank_cd'
1357     LANGUAGE c IMMUTABLE STRICT;
1358
1359
1360 --
1361 -- TOC entry 172 (OID 618765)
1362 -- Name: rank_cd(tsvector, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
1363 --
1364
1365 CREATE FUNCTION rank_cd(tsvector, tsquery) RETURNS real
1366     AS '$libdir/tsearch2', 'rank_cd_def'
1367     LANGUAGE c IMMUTABLE STRICT;
1368
1369
1370 --
1371 -- TOC entry 173 (OID 618766)
1372 -- Name: rank_cd(tsvector, tsquery, integer); Type: FUNCTION; Schema: public; Owner: postgres
1373 --
1374
1375 CREATE FUNCTION rank_cd(tsvector, tsquery, integer) RETURNS real
1376     AS '$libdir/tsearch2', 'rank_cd_def'
1377     LANGUAGE c IMMUTABLE STRICT;
1378
1379
1380 --
1381 -- TOC entry 174 (OID 618767)
1382 -- Name: headline(oid, text, tsquery, text); Type: FUNCTION; Schema: public; Owner: postgres
1383 --
1384
1385 CREATE FUNCTION headline(oid, text, tsquery, text) RETURNS text
1386     AS '$libdir/tsearch2', 'headline'
1387     LANGUAGE c IMMUTABLE STRICT;
1388
1389
1390 --
1391 -- TOC entry 175 (OID 618768)
1392 -- Name: headline(oid, text, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
1393 --
1394
1395 CREATE FUNCTION headline(oid, text, tsquery) RETURNS text
1396     AS '$libdir/tsearch2', 'headline'
1397     LANGUAGE c IMMUTABLE STRICT;
1398
1399
1400 --
1401 -- TOC entry 176 (OID 618769)
1402 -- Name: headline(text, text, tsquery, text); Type: FUNCTION; Schema: public; Owner: postgres
1403 --
1404
1405 CREATE FUNCTION headline(text, text, tsquery, text) RETURNS text
1406     AS '$libdir/tsearch2', 'headline_byname'
1407     LANGUAGE c IMMUTABLE STRICT;
1408
1409
1410 --
1411 -- TOC entry 177 (OID 618770)
1412 -- Name: headline(text, text, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
1413 --
1414
1415 CREATE FUNCTION headline(text, text, tsquery) RETURNS text
1416     AS '$libdir/tsearch2', 'headline_byname'
1417     LANGUAGE c IMMUTABLE STRICT;
1418
1419
1420 --
1421 -- TOC entry 178 (OID 618771)
1422 -- Name: headline(text, tsquery, text); Type: FUNCTION; Schema: public; Owner: postgres
1423 --
1424
1425 CREATE FUNCTION headline(text, tsquery, text) RETURNS text
1426     AS '$libdir/tsearch2', 'headline_current'
1427     LANGUAGE c IMMUTABLE STRICT;
1428
1429
1430 --
1431 -- TOC entry 179 (OID 618772)
1432 -- Name: headline(text, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
1433 --
1434
1435 CREATE FUNCTION headline(text, tsquery) RETURNS text
1436     AS '$libdir/tsearch2', 'headline_current'
1437     LANGUAGE c IMMUTABLE STRICT;
1438
1439
1440 --
1441 -- TOC entry 180 (OID 618774)
1442 -- Name: gtsvector_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres
1443 --
1444
1445 CREATE FUNCTION gtsvector_in(cstring) RETURNS gtsvector
1446     AS '$libdir/tsearch2', 'gtsvector_in'
1447     LANGUAGE c STRICT;
1448
1449
1450 --
1451 -- TOC entry 181 (OID 618775)
1452 -- Name: gtsvector_out(gtsvector); Type: FUNCTION; Schema: public; Owner: postgres
1453 --
1454
1455 CREATE FUNCTION gtsvector_out(gtsvector) RETURNS cstring
1456     AS '$libdir/tsearch2', 'gtsvector_out'
1457     LANGUAGE c STRICT;
1458
1459
1460 --
1461 -- TOC entry 9 (OID 618773)
1462 -- Name: gtsvector; Type: TYPE; Schema: public; Owner: postgres
1463 --
1464
1465 CREATE TYPE gtsvector (
1466     INTERNALLENGTH = variable,
1467     INPUT = gtsvector_in,
1468     OUTPUT = gtsvector_out,
1469     ALIGNMENT = int4,
1470     STORAGE = plain
1471 );
1472
1473
1474 --
1475 -- TOC entry 182 (OID 618777)
1476 -- Name: gtsvector_consistent(gtsvector, internal, integer); Type: FUNCTION; Schema: public; Owner: postgres
1477 --
1478
1479 CREATE FUNCTION gtsvector_consistent(gtsvector, internal, integer) RETURNS boolean
1480     AS '$libdir/tsearch2', 'gtsvector_consistent'
1481     LANGUAGE c;
1482
1483
1484 --
1485 -- TOC entry 183 (OID 618778)
1486 -- Name: gtsvector_compress(internal); Type: FUNCTION; Schema: public; Owner: postgres
1487 --
1488
1489 CREATE FUNCTION gtsvector_compress(internal) RETURNS internal
1490     AS '$libdir/tsearch2', 'gtsvector_compress'
1491     LANGUAGE c;
1492
1493
1494 --
1495 -- TOC entry 184 (OID 618779)
1496 -- Name: gtsvector_decompress(internal); Type: FUNCTION; Schema: public; Owner: postgres
1497 --
1498
1499 CREATE FUNCTION gtsvector_decompress(internal) RETURNS internal
1500     AS '$libdir/tsearch2', 'gtsvector_decompress'
1501     LANGUAGE c;
1502
1503
1504 --
1505 -- TOC entry 185 (OID 618780)
1506 -- Name: gtsvector_penalty(internal, internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
1507 --
1508
1509 CREATE FUNCTION gtsvector_penalty(internal, internal, internal) RETURNS internal
1510     AS '$libdir/tsearch2', 'gtsvector_penalty'
1511     LANGUAGE c STRICT;
1512
1513
1514 --
1515 -- TOC entry 186 (OID 618781)
1516 -- Name: gtsvector_picksplit(internal, internal); Type: FUNCTION; Schema: public; Owner: postgres
1517 --
1518
1519 CREATE FUNCTION gtsvector_picksplit(internal, internal) RETURNS internal
1520     AS '$libdir/tsearch2', 'gtsvector_picksplit'
1521     LANGUAGE c;
1522
1523
1524 --
1525 -- TOC entry 187 (OID 618782)
1526 -- Name: gtsvector_union(bytea, internal); Type: FUNCTION; Schema: public; Owner: postgres
1527 --
1528
1529 CREATE FUNCTION gtsvector_union(bytea, internal) RETURNS integer[]
1530     AS '$libdir/tsearch2', 'gtsvector_union'
1531     LANGUAGE c;
1532
1533
1534 --
1535 -- TOC entry 188 (OID 618783)
1536 -- Name: gtsvector_same(gtsvector, gtsvector, internal); Type: FUNCTION; Schema: public; Owner: postgres
1537 --
1538
1539 CREATE FUNCTION gtsvector_same(gtsvector, gtsvector, internal) RETURNS internal
1540     AS '$libdir/tsearch2', 'gtsvector_same'
1541     LANGUAGE c;
1542
1543
1544 --
1545 -- TOC entry 197 (OID 618784)
1546 -- Name: gist_tsvector_ops; Type: OPERATOR CLASS; Schema: public; Owner: postgres
1547 --
1548
1549 CREATE OPERATOR CLASS gist_tsvector_ops
1550     DEFAULT FOR TYPE tsvector USING gist AS
1551     STORAGE gtsvector ,
1552     OPERATOR 1 @@(tsvector,tsquery) RECHECK ,
1553     FUNCTION 1 gtsvector_consistent(gtsvector,internal,integer) ,
1554     FUNCTION 2 gtsvector_union(bytea,internal) ,
1555     FUNCTION 3 gtsvector_compress(internal) ,
1556     FUNCTION 4 gtsvector_decompress(internal) ,
1557     FUNCTION 5 gtsvector_penalty(internal,internal,internal) ,
1558     FUNCTION 6 gtsvector_picksplit(internal,internal) ,
1559     FUNCTION 7 gtsvector_same(gtsvector,gtsvector,internal);
1560
1561
1562 --
1563 -- TOC entry 10 (OID 618786)
1564 -- Name: statinfo; Type: TYPE; Schema: public; Owner: postgres
1565 --
1566
1567 CREATE TYPE statinfo AS (
1568         word text,
1569         ndoc integer,
1570         nentry integer
1571 );
1572
1573
1574 --
1575 -- TOC entry 189 (OID 618787)
1576 -- Name: stat(text); Type: FUNCTION; Schema: public; Owner: postgres
1577 --
1578
1579 CREATE FUNCTION stat(text) RETURNS SETOF statinfo
1580     AS '$libdir/tsearch2', 'ts_stat'
1581     LANGUAGE c STRICT;
1582
1583
1584 --
1585 -- TOC entry 190 (OID 618788)
1586 -- Name: reset_tsearch(); Type: FUNCTION; Schema: public; Owner: postgres
1587 --
1588
1589 CREATE FUNCTION reset_tsearch() RETURNS void
1590     AS '$libdir/tsearch2', 'reset_tsearch'
1591     LANGUAGE c STRICT;
1592
1593
1594 --
1595 -- TOC entry 191 (OID 618789)
1596 -- Name: get_covers(tsvector, tsquery); Type: FUNCTION; Schema: public; Owner: postgres
1597 --
1598
1599 CREATE FUNCTION get_covers(tsvector, tsquery) RETURNS text
1600     AS '$libdir/tsearch2', 'get_covers'
1601     LANGUAGE c STRICT;
1602
1603
1604 --
1605 -- TOC entry 11 (OID 618791)
1606 -- Name: tsdebug; Type: TYPE; Schema: public; Owner: postgres
1607 --
1608
1609 CREATE TYPE tsdebug AS (
1610         ts_name text,
1611         tok_type text,
1612         description text,
1613         token text,
1614         dict_name text[],
1615         tsvector tsvector
1616 );
1617
1618
1619 --
1620 -- TOC entry 192 (OID 618792)
1621 -- Name: _get_parser_from_curcfg(); Type: FUNCTION; Schema: public; Owner: postgres
1622 --
1623
1624 CREATE FUNCTION _get_parser_from_curcfg() RETURNS text
1625     AS ' select prs_name from pg_ts_cfg where oid = show_curcfg() '
1626     LANGUAGE sql IMMUTABLE STRICT;
1627
1628
1629 --
1630 -- TOC entry 193 (OID 618793)
1631 -- Name: ts_debug(text); Type: FUNCTION; Schema: public; Owner: postgres
1632 --
1633
1634 CREATE FUNCTION ts_debug(text) RETURNS SETOF tsdebug
1635     AS '
1636 select 
1637         m.ts_name,
1638         t.alias as tok_type,
1639         t.descr as description,
1640         p.token,
1641         m.dict_name,
1642         strip(to_tsvector(p.token)) as tsvector
1643 from
1644         parse( _get_parser_from_curcfg(), $1 ) as p,
1645         token_type() as t,
1646         pg_ts_cfgmap as m,
1647         pg_ts_cfg as c
1648 where
1649         t.tokid=p.tokid and
1650         t.alias = m.tok_alias and 
1651         m.ts_name=c.ts_name and 
1652         c.oid=show_curcfg() 
1653 '
1654     LANGUAGE sql STRICT;
1655
1656
1657 --
1658 -- TOC entry 84 (OID 536388)
1659 -- Name: hostnames_hostid_name_uq; Type: INDEX; Schema: public; Owner: rich
1660 --
1661
1662 CREATE UNIQUE INDEX hostnames_hostid_name_uq ON hostnames USING btree (hostid, name);
1663
1664
1665 --
1666 -- TOC entry 79 (OID 536419)
1667 -- Name: pages_url_uq; Type: INDEX; Schema: public; Owner: rich
1668 --
1669
1670 CREATE UNIQUE INDEX pages_url_uq ON pages USING btree (hostid, url);
1671
1672
1673 --
1674 -- TOC entry 86 (OID 540251)
1675 -- Name: images_name_uq; Type: INDEX; Schema: public; Owner: rich
1676 --
1677
1678 CREATE UNIQUE INDEX images_name_uq ON images USING btree (hostid, name);
1679
1680
1681 --
1682 -- TOC entry 88 (OID 540252)
1683 -- Name: files_name_uq; Type: INDEX; Schema: public; Owner: rich
1684 --
1685
1686 CREATE UNIQUE INDEX files_name_uq ON files USING btree (hostid, name);
1687
1688
1689 --
1690 -- TOC entry 91 (OID 540831)
1691 -- Name: users_name_uq; Type: INDEX; Schema: public; Owner: rich
1692 --
1693
1694 CREATE UNIQUE INDEX users_name_uq ON users USING btree (hostid, name);
1695
1696
1697 --
1698 -- TOC entry 90 (OID 540946)
1699 -- Name: users_id_uq; Type: INDEX; Schema: public; Owner: rich
1700 --
1701
1702 CREATE UNIQUE INDEX users_id_uq ON users USING btree (hostid, id);
1703
1704
1705 --
1706 -- TOC entry 94 (OID 540970)
1707 -- Name: sitemenu_ordering_uq; Type: INDEX; Schema: public; Owner: rich
1708 --
1709
1710 CREATE UNIQUE INDEX sitemenu_ordering_uq ON sitemenu USING btree (hostid, ordering);
1711
1712
1713 --
1714 -- TOC entry 95 (OID 540971)
1715 -- Name: sitemenu_url_uq; Type: INDEX; Schema: public; Owner: rich
1716 --
1717
1718 CREATE UNIQUE INDEX sitemenu_url_uq ON sitemenu USING btree (hostid, url);
1719
1720
1721 --
1722 -- TOC entry 98 (OID 542626)
1723 -- Name: contact_emails_uq; Type: INDEX; Schema: public; Owner: rich
1724 --
1725
1726 CREATE UNIQUE INDEX contact_emails_uq ON contact_emails USING btree (contactid, email);
1727
1728
1729 --
1730 -- TOC entry 99 (OID 543505)
1731 -- Name: themes_theme_css_uq; Type: INDEX; Schema: public; Owner: rich
1732 --
1733
1734 CREATE UNIQUE INDEX themes_theme_css_uq ON themes USING btree (theme_css);
1735
1736
1737 --
1738 -- TOC entry 100 (OID 543763)
1739 -- Name: page_emails_email_uq; Type: INDEX; Schema: public; Owner: rich
1740 --
1741
1742 CREATE UNIQUE INDEX page_emails_email_uq ON page_emails USING btree (hostid, url, email);
1743
1744
1745 --
1746 -- TOC entry 101 (OID 543795)
1747 -- Name: mailing_lists_email_uq; Type: INDEX; Schema: public; Owner: rich
1748 --
1749
1750 CREATE UNIQUE INDEX mailing_lists_email_uq ON mailing_lists USING btree (hostid, email);
1751
1752
1753 --
1754 -- TOC entry 96 (OID 543880)
1755 -- Name: contacts_name_uq; Type: INDEX; Schema: public; Owner: rich
1756 --
1757
1758 CREATE UNIQUE INDEX contacts_name_uq ON contacts USING btree (hostid, name);
1759
1760
1761 --
1762 -- TOC entry 102 (OID 544454)
1763 -- Name: links_uq; Type: INDEX; Schema: public; Owner: rich
1764 --
1765
1766 CREATE UNIQUE INDEX links_uq ON links USING btree (hostid, from_url, to_url);
1767
1768
1769 --
1770 -- TOC entry 103 (OID 547951)
1771 -- Name: templates_ext_ord_uq; Type: INDEX; Schema: public; Owner: rich
1772 --
1773
1774 CREATE UNIQUE INDEX templates_ext_ord_uq ON templates USING btree (extension, ordering);
1775
1776
1777 --
1778 -- TOC entry 105 (OID 547952)
1779 -- Name: templates_title_uq; Type: INDEX; Schema: public; Owner: rich
1780 --
1781
1782 CREATE UNIQUE INDEX templates_title_uq ON templates USING btree (title_regexp);
1783
1784
1785 --
1786 -- TOC entry 106 (OID 547953)
1787 -- Name: templates_url_uq; Type: INDEX; Schema: public; Owner: rich
1788 --
1789
1790 CREATE UNIQUE INDEX templates_url_uq ON templates USING btree (url_regexp);
1791
1792
1793 --
1794 -- TOC entry 107 (OID 551151)
1795 -- Name: recently_visited_uq; Type: INDEX; Schema: public; Owner: rich
1796 --
1797
1798 CREATE UNIQUE INDEX recently_visited_uq ON recently_visited USING btree (userid, hostid, url);
1799
1800
1801 --
1802 -- TOC entry 108 (OID 552155)
1803 -- Name: messages_inet_message_id_uq; Type: INDEX; Schema: public; Owner: rich
1804 --
1805
1806 CREATE UNIQUE INDEX messages_inet_message_id_uq ON messages USING btree (hostid, inet_message_id);
1807
1808
1809 --
1810 -- TOC entry 78 (OID 552684)
1811 -- Name: pages_url_ix; Type: INDEX; Schema: public; Owner: rich
1812 --
1813
1814 CREATE INDEX pages_url_ix ON pages USING btree (url);
1815
1816
1817 --
1818 -- TOC entry 77 (OID 552685)
1819 -- Name: pages_redirect_ix; Type: INDEX; Schema: public; Owner: rich
1820 --
1821
1822 CREATE INDEX pages_redirect_ix ON pages USING btree (redirect);
1823
1824
1825 --
1826 -- TOC entry 74 (OID 618795)
1827 -- Name: pages_fti_idx; Type: INDEX; Schema: public; Owner: rich
1828 --
1829
1830 CREATE INDEX pages_fti_idx ON pages USING gist (title_description_fti);
1831
1832
1833 --
1834 -- TOC entry 80 (OID 620946)
1835 -- Name: contents_fti_idx; Type: INDEX; Schema: public; Owner: rich
1836 --
1837
1838 CREATE INDEX contents_fti_idx ON contents USING gist (content_fti);
1839
1840
1841 --
1842 -- TOC entry 81 (OID 622207)
1843 -- Name: contents_pageid_idx; Type: INDEX; Schema: public; Owner: rich
1844 --
1845
1846 CREATE INDEX contents_pageid_idx ON contents USING btree (pageid);
1847
1848
1849 --
1850 -- TOC entry 85 (OID 622519)
1851 -- Name: hostnames_name_uq; Type: INDEX; Schema: public; Owner: rich
1852 --
1853
1854 CREATE UNIQUE INDEX hostnames_name_uq ON hostnames USING btree (name);
1855
1856
1857 --
1858 -- TOC entry 93 (OID 622520)
1859 -- Name: usercookies_cookie_idx; Type: INDEX; Schema: public; Owner: rich
1860 --
1861
1862 CREATE INDEX usercookies_cookie_idx ON usercookies USING btree (cookie);
1863
1864
1865 --
1866 -- TOC entry 75 (OID 623111)
1867 -- Name: pages_lc_title; Type: INDEX; Schema: public; Owner: rich
1868 --
1869
1870 CREATE INDEX pages_lc_title ON pages USING btree (lower(title));
1871
1872
1873 --
1874 -- TOC entry 76 (OID 536012)
1875 -- Name: pages_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1876 --
1877
1878 ALTER TABLE ONLY pages
1879     ADD CONSTRAINT pages_pkey PRIMARY KEY (id);
1880
1881
1882 --
1883 -- TOC entry 82 (OID 536027)
1884 -- Name: contents_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1885 --
1886
1887 ALTER TABLE ONLY contents
1888     ADD CONSTRAINT contents_pkey PRIMARY KEY (id);
1889
1890
1891 --
1892 -- TOC entry 83 (OID 536377)
1893 -- Name: hosts_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1894 --
1895
1896 ALTER TABLE ONLY hosts
1897     ADD CONSTRAINT hosts_pkey PRIMARY KEY (id);
1898
1899
1900 --
1901 -- TOC entry 87 (OID 537158)
1902 -- Name: images_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1903 --
1904
1905 ALTER TABLE ONLY images
1906     ADD CONSTRAINT images_pkey PRIMARY KEY (id);
1907
1908
1909 --
1910 -- TOC entry 89 (OID 537173)
1911 -- Name: files_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1912 --
1913
1914 ALTER TABLE ONLY files
1915     ADD CONSTRAINT files_pkey PRIMARY KEY (id);
1916
1917
1918 --
1919 -- TOC entry 92 (OID 540825)
1920 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1921 --
1922
1923 ALTER TABLE ONLY users
1924     ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1925
1926
1927 --
1928 -- TOC entry 97 (OID 542611)
1929 -- Name: contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1930 --
1931
1932 ALTER TABLE ONLY contacts
1933     ADD CONSTRAINT contacts_pkey PRIMARY KEY (id);
1934
1935
1936 --
1937 -- TOC entry 104 (OID 547945)
1938 -- Name: templates_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1939 --
1940
1941 ALTER TABLE ONLY templates
1942     ADD CONSTRAINT templates_pkey PRIMARY KEY (id);
1943
1944
1945 --
1946 -- TOC entry 109 (OID 551681)
1947 -- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1948 --
1949
1950 ALTER TABLE ONLY messages
1951     ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
1952
1953
1954 --
1955 -- TOC entry 110 (OID 607081)
1956 -- Name: powered_by_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1957 --
1958
1959 ALTER TABLE ONLY powered_by
1960     ADD CONSTRAINT powered_by_pkey PRIMARY KEY (id);
1961
1962
1963 --
1964 -- TOC entry 111 (OID 607141)
1965 -- Name: pending_email_changes_pkey; Type: CONSTRAINT; Schema: public; Owner: rich
1966 --
1967
1968 ALTER TABLE ONLY pending_email_changes
1969     ADD CONSTRAINT pending_email_changes_pkey PRIMARY KEY ("key");
1970
1971
1972 --
1973 -- TOC entry 112 (OID 618611)
1974 -- Name: pg_ts_dict_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
1975 --
1976
1977 ALTER TABLE ONLY pg_ts_dict
1978     ADD CONSTRAINT pg_ts_dict_pkey PRIMARY KEY (dict_name);
1979
1980
1981 --
1982 -- TOC entry 113 (OID 618637)
1983 -- Name: pg_ts_parser_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
1984 --
1985
1986 ALTER TABLE ONLY pg_ts_parser
1987     ADD CONSTRAINT pg_ts_parser_pkey PRIMARY KEY (prs_name);
1988
1989
1990 --
1991 -- TOC entry 114 (OID 618662)
1992 -- Name: pg_ts_cfg_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
1993 --
1994
1995 ALTER TABLE ONLY pg_ts_cfg
1996     ADD CONSTRAINT pg_ts_cfg_pkey PRIMARY KEY (ts_name);
1997
1998
1999 --
2000 -- TOC entry 115 (OID 618669)
2001 -- Name: pg_ts_cfgmap_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
2002 --
2003
2004 ALTER TABLE ONLY pg_ts_cfgmap
2005     ADD CONSTRAINT pg_ts_cfgmap_pkey PRIMARY KEY (ts_name, tok_alias);
2006
2007
2008 --
2009 -- TOC entry 202 (OID 536029)
2010 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2011 --
2012
2013 ALTER TABLE ONLY contents
2014     ADD CONSTRAINT "$1" FOREIGN KEY (pageid) REFERENCES pages(id);
2015
2016
2017 --
2018 -- TOC entry 206 (OID 536384)
2019 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2020 --
2021
2022 ALTER TABLE ONLY hostnames
2023     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2024
2025
2026 --
2027 -- TOC entry 203 (OID 536394)
2028 -- Name: hosts_hostname_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2029 --
2030
2031 ALTER TABLE ONLY hosts
2032     ADD CONSTRAINT hosts_hostname_cn FOREIGN KEY (id, canonical_hostname) REFERENCES hostnames(hostid, name) DEFERRABLE;
2033
2034
2035 --
2036 -- TOC entry 198 (OID 536404)
2037 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2038 --
2039
2040 ALTER TABLE ONLY pages
2041     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2042
2043
2044 --
2045 -- TOC entry 207 (OID 537160)
2046 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2047 --
2048
2049 ALTER TABLE ONLY images
2050     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2051
2052
2053 --
2054 -- TOC entry 208 (OID 537175)
2055 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2056 --
2057
2058 ALTER TABLE ONLY files
2059     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2060
2061
2062 --
2063 -- TOC entry 199 (OID 539155)
2064 -- Name: pages_redirect_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2065 --
2066
2067 ALTER TABLE ONLY pages
2068     ADD CONSTRAINT pages_redirect_cn FOREIGN KEY (hostid, redirect) REFERENCES pages(hostid, url) DEFERRABLE;
2069
2070
2071 --
2072 -- TOC entry 209 (OID 540827)
2073 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2074 --
2075
2076 ALTER TABLE ONLY users
2077     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2078
2079
2080 --
2081 -- TOC entry 210 (OID 540837)
2082 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2083 --
2084
2085 ALTER TABLE ONLY usercookies
2086     ADD CONSTRAINT "$1" FOREIGN KEY (userid) REFERENCES users(id);
2087
2088
2089 --
2090 -- TOC entry 200 (OID 540942)
2091 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: rich
2092 --
2093
2094 ALTER TABLE ONLY pages
2095     ADD CONSTRAINT "$2" FOREIGN KEY (logged_user) REFERENCES users(id);
2096
2097
2098 --
2099 -- TOC entry 201 (OID 540947)
2100 -- Name: pages_user_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2101 --
2102
2103 ALTER TABLE ONLY pages
2104     ADD CONSTRAINT pages_user_cn FOREIGN KEY (hostid, logged_user) REFERENCES users(hostid, id);
2105
2106
2107 --
2108 -- TOC entry 211 (OID 540966)
2109 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2110 --
2111
2112 ALTER TABLE ONLY sitemenu
2113     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2114
2115
2116 --
2117 -- TOC entry 212 (OID 540972)
2118 -- Name: sitemenu_url_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2119 --
2120
2121 ALTER TABLE ONLY sitemenu
2122     ADD CONSTRAINT sitemenu_url_cn FOREIGN KEY (hostid, url) REFERENCES pages(hostid, url) DEFERRABLE;
2123
2124
2125 --
2126 -- TOC entry 213 (OID 542613)
2127 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2128 --
2129
2130 ALTER TABLE ONLY contacts
2131     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2132
2133
2134 --
2135 -- TOC entry 214 (OID 542622)
2136 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2137 --
2138
2139 ALTER TABLE ONLY contact_emails
2140     ADD CONSTRAINT "$1" FOREIGN KEY (contactid) REFERENCES contacts(id);
2141
2142
2143 --
2144 -- TOC entry 204 (OID 543506)
2145 -- Name: hosts_theme_css_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2146 --
2147
2148 ALTER TABLE ONLY hosts
2149     ADD CONSTRAINT hosts_theme_css_cn FOREIGN KEY (theme_css) REFERENCES themes(theme_css);
2150
2151
2152 --
2153 -- TOC entry 215 (OID 543759)
2154 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2155 --
2156
2157 ALTER TABLE ONLY page_emails
2158     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2159
2160
2161 --
2162 -- TOC entry 216 (OID 543764)
2163 -- Name: page_emails_url_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2164 --
2165
2166 ALTER TABLE ONLY page_emails
2167     ADD CONSTRAINT page_emails_url_cn FOREIGN KEY (hostid, url) REFERENCES pages(hostid, url) DEFERRABLE;
2168
2169
2170 --
2171 -- TOC entry 217 (OID 543791)
2172 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2173 --
2174
2175 ALTER TABLE ONLY mailing_lists
2176     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2177
2178
2179 --
2180 -- TOC entry 218 (OID 544450)
2181 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2182 --
2183
2184 ALTER TABLE ONLY links
2185     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2186
2187
2188 --
2189 -- TOC entry 219 (OID 544455)
2190 -- Name: links_from_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2191 --
2192
2193 ALTER TABLE ONLY links
2194     ADD CONSTRAINT links_from_cn FOREIGN KEY (hostid, from_url) REFERENCES pages(hostid, url) DEFERRABLE;
2195
2196
2197 --
2198 -- TOC entry 220 (OID 551129)
2199 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2200 --
2201
2202 ALTER TABLE ONLY recently_visited
2203     ADD CONSTRAINT "$1" FOREIGN KEY (userid) REFERENCES users(id);
2204
2205
2206 --
2207 -- TOC entry 221 (OID 551133)
2208 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: rich
2209 --
2210
2211 ALTER TABLE ONLY recently_visited
2212     ADD CONSTRAINT "$2" FOREIGN KEY (hostid) REFERENCES hosts(id);
2213
2214
2215 --
2216 -- TOC entry 222 (OID 551137)
2217 -- Name: recently_visited_url_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2218 --
2219
2220 ALTER TABLE ONLY recently_visited
2221     ADD CONSTRAINT recently_visited_url_cn FOREIGN KEY (hostid, url) REFERENCES pages(hostid, url) DEFERRABLE;
2222
2223
2224 --
2225 -- TOC entry 223 (OID 551141)
2226 -- Name: recently_visited_userid_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2227 --
2228
2229 ALTER TABLE ONLY recently_visited
2230     ADD CONSTRAINT recently_visited_userid_cn FOREIGN KEY (hostid, userid) REFERENCES users(hostid, id);
2231
2232
2233 --
2234 -- TOC entry 225 (OID 551690)
2235 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2236 --
2237
2238 ALTER TABLE ONLY msg_references
2239     ADD CONSTRAINT "$1" FOREIGN KEY (message_id) REFERENCES messages(id);
2240
2241
2242 --
2243 -- TOC entry 224 (OID 551694)
2244 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2245 --
2246
2247 ALTER TABLE ONLY messages
2248     ADD CONSTRAINT "$1" FOREIGN KEY (hostid) REFERENCES hosts(id);
2249
2250
2251 --
2252 -- TOC entry 205 (OID 607083)
2253 -- Name: hosts_powered_by_cn; Type: FK CONSTRAINT; Schema: public; Owner: rich
2254 --
2255
2256 ALTER TABLE ONLY hosts
2257     ADD CONSTRAINT hosts_powered_by_cn FOREIGN KEY (powered_by) REFERENCES powered_by(id);
2258
2259
2260 --
2261 -- TOC entry 226 (OID 607143)
2262 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: rich
2263 --
2264
2265 ALTER TABLE ONLY pending_email_changes
2266     ADD CONSTRAINT "$1" FOREIGN KEY (userid) REFERENCES users(id);
2267
2268
2269 --
2270 -- TOC entry 227 (OID 618794)
2271 -- Name: pages_fti_tr; Type: TRIGGER; Schema: public; Owner: rich
2272 --
2273
2274 CREATE TRIGGER pages_fti_tr
2275     BEFORE INSERT OR UPDATE ON pages
2276     FOR EACH ROW
2277     EXECUTE PROCEDURE tsearch2('title_description_fti', 'title', 'description');
2278
2279
2280 --
2281 -- TOC entry 228 (OID 618796)
2282 -- Name: contents_fti_tr; Type: TRIGGER; Schema: public; Owner: rich
2283 --
2284
2285 CREATE TRIGGER contents_fti_tr
2286     BEFORE INSERT OR UPDATE ON contents
2287     FOR EACH ROW
2288     EXECUTE PROCEDURE tsearch2('content_fti', 'sectionname', 'content');
2289
2290
2291 --
2292 -- TOC entry 3 (OID 2200)
2293 -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
2294 --
2295
2296 COMMENT ON SCHEMA public IS 'Standard public namespace';
2297
2298
2299 --
2300 -- TOC entry 37 (OID 543592)
2301 -- Name: TABLE server_settings; Type: COMMENT; Schema: public; Owner: rich
2302 --
2303
2304 COMMENT ON TABLE server_settings IS 'This table contains global settings for the server.  There should be only one row in this table.  If you modify any setting, you must restart the webserver for the change to take effect.  The "version" field is intended to be some sort of database version, but is currently unused.';
2305
2306
2307 --
2308 -- TOC entry 162 (OID 618754)
2309 -- Name: FUNCTION exectsq(tsvector, tsquery); Type: COMMENT; Schema: public; Owner: postgres
2310 --
2311
2312 COMMENT ON FUNCTION exectsq(tsvector, tsquery) IS 'boolean operation with text index';
2313
2314
2315 --
2316 -- TOC entry 164 (OID 618755)
2317 -- Name: FUNCTION rexectsq(tsquery, tsvector); Type: COMMENT; Schema: public; Owner: postgres
2318 --
2319
2320 COMMENT ON FUNCTION rexectsq(tsquery, tsvector) IS 'boolean operation with text index';
2321
2322
2323 --
2324 -- PostgreSQL database dump
2325 --
2326
2327 SET client_encoding = 'UNICODE';
2328 SET check_function_bodies = false;
2329
2330 SET search_path = public, pg_catalog;
2331
2332 --
2333 -- Data for TOC entry 3 (OID 547939)
2334 -- Name: templates; Type: TABLE DATA; Schema: public; Owner: rich
2335 --
2336
2337 COPY templates (id, title_regexp, url_regexp, extension, ordering) FROM stdin;
2338 1       ^(199[0-9]|20[0-9][0-9])/(0[1-9]|1[0-2])/(0[1-9]|1[0-9]|2[0-9]|3[01])$  ^(199[0-9]|20[0-9][0-9])/(0[1-9]|1[0-2])/(0[1-9]|1[0-9]|2[0-9]|3[01])$  calendar        10
2339 3       ^(199[0-9]|20[0-9][0-9])/(0[1-9]|1[0-2])$       ^(199[0-9]|20[0-9][0-9])/(0[1-9]|1[0-2])$       calendar        20
2340 4       ^(199[0-9]|20[0-9][0-9])$       ^(199[0-9]|20[0-9][0-9])$       calendar        30
2341 \.
2342
2343
2344 --
2345 -- TOC entry 2 (OID 547937)
2346 -- Name: templates_id_seq; Type: SEQUENCE SET; Schema: public; Owner: rich
2347 --
2348
2349 SELECT pg_catalog.setval('templates_id_seq', 4, true);
2350
2351
2352 --
2353 -- PostgreSQL database dump
2354 --
2355
2356 SET client_encoding = 'UNICODE';
2357 SET check_function_bodies = false;
2358
2359 SET search_path = public, pg_catalog;
2360
2361 --
2362 -- Data for TOC entry 2 (OID 543499)
2363 -- Name: themes; Type: TABLE DATA; Schema: public; Owner: rich
2364 --
2365
2366 COPY themes (theme_css, name, description) FROM stdin;
2367 /_css/easyweb.css       Merjis Easy Web Marketing       This is the easy web marketing stylesheet developed by Merjis Ltd.  Please see http://www.merjis.com/
2368 /_css/basic.css Basic styles only       Only the most essential styles.  This is a good starting point if you want to completely restyle pages using site-specific CSS.
2369 \.
2370
2371