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