source: waeup_z2sql/trunk/waeup-schema.sql @ 81

Last change on this file since 81 was 61, checked in by toni, 19 years ago

Initial import

File size: 19.0 KB
Line 
1--
2-- PostgreSQL database dump
3--
4
5SET client_encoding = 'UNICODE';
6SET check_function_bodies = false;
7
8SET SESSION AUTHORIZATION 'postgres';
9
10SET search_path = public, pg_catalog;
11
12--
13-- TOC entry 34 (OID 31835)
14-- Name: plpgsql_call_handler(); Type: FUNC PROCEDURAL LANGUAGE; Schema: public; Owner: postgres
15--
16
17CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler
18    AS '/usr/lib/postgresql/lib/plpgsql.so', 'plpgsql_call_handler'
19    LANGUAGE c;
20
21
22SET SESSION AUTHORIZATION DEFAULT;
23
24--
25-- TOC entry 33 (OID 31836)
26-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: public; Owner:
27--
28
29CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler;
30
31
32SET SESSION AUTHORIZATION 'postgres';
33
34--
35-- TOC entry 4 (OID 2200)
36-- Name: public; Type: ACL; Schema: -; Owner: postgres
37--
38
39REVOKE ALL ON SCHEMA public FROM PUBLIC;
40REVOKE ALL ON SCHEMA public FROM postgres;
41GRANT ALL ON SCHEMA public TO PUBLIC;
42GRANT ALL ON SCHEMA public TO imke;
43GRANT CREATE ON SCHEMA public TO "109";
44
45
46SET SESSION AUTHORIZATION 'postgres';
47
48--
49-- TOC entry 35 (OID 74293)
50-- Name: char(integer); Type: FUNCTION; Schema: public; Owner: postgres
51--
52
53CREATE FUNCTION "char"(integer) RETURNS text
54    AS '
55    SELECT chr($1);
56'
57    LANGUAGE sql;
58
59
60--
61-- TOC entry 36 (OID 74294)
62-- Name: concat(text, text); Type: FUNCTION; Schema: public; Owner: postgres
63--
64
65CREATE FUNCTION concat(text, text) RETURNS text
66    AS '
67    SELECT $1 || $2;
68'
69    LANGUAGE sql;
70
71
72--
73-- TOC entry 37 (OID 74295)
74-- Name: insert(text, integer, integer, text); Type: FUNCTION; Schema: public; Owner: postgres
75--
76
77CREATE FUNCTION "insert"(text, integer, integer, text) RETURNS text
78    AS '
79    SELECT substring($1 from 1 for $2 - 1) || $4 || substring($1 from $2 + $3);
80'
81    LANGUAGE sql;
82
83
84--
85-- TOC entry 38 (OID 74296)
86-- Name: lcase(text); Type: FUNCTION; Schema: public; Owner: postgres
87--
88
89CREATE FUNCTION lcase(text) RETURNS text
90    AS '
91    SELECT lower($1);
92'
93    LANGUAGE sql;
94
95
96--
97-- TOC entry 39 (OID 74297)
98-- Name: left(text, integer); Type: FUNCTION; Schema: public; Owner: postgres
99--
100
101CREATE FUNCTION "left"(text, integer) RETURNS text
102    AS '
103    SELECT substring($1 for $2);
104'
105    LANGUAGE sql;
106
107
108--
109-- TOC entry 40 (OID 74298)
110-- Name: locate(text, text); Type: FUNCTION; Schema: public; Owner: postgres
111--
112
113CREATE FUNCTION locate(text, text) RETURNS integer
114    AS '
115    SELECT position($1 in $2);
116'
117    LANGUAGE sql;
118
119
120--
121-- TOC entry 41 (OID 74299)
122-- Name: locate(text, text, integer); Type: FUNCTION; Schema: public; Owner: postgres
123--
124
125CREATE FUNCTION locate(text, text, integer) RETURNS integer
126    AS '
127    SELECT position($1 in substring($2 from $3)) + $3 - 1;
128'
129    LANGUAGE sql;
130
131
132--
133-- TOC entry 42 (OID 74300)
134-- Name: right(text, integer); Type: FUNCTION; Schema: public; Owner: postgres
135--
136
137CREATE FUNCTION "right"(text, integer) RETURNS text
138    AS '
139    SELECT substring($1 from char_length($1) - $2 + 1);
140'
141    LANGUAGE sql;
142
143
144--
145-- TOC entry 43 (OID 74301)
146-- Name: space(integer); Type: FUNCTION; Schema: public; Owner: postgres
147--
148
149CREATE FUNCTION space(integer) RETURNS text
150    AS '
151    SELECT repeat('' '', $1);
152'
153    LANGUAGE sql;
154
155
156--
157-- TOC entry 44 (OID 74302)
158-- Name: ucase(text); Type: FUNCTION; Schema: public; Owner: postgres
159--
160
161CREATE FUNCTION ucase(text) RETURNS text
162    AS '
163    SELECT upper($1);
164'
165    LANGUAGE sql;
166
167
168--
169-- TOC entry 45 (OID 74303)
170-- Name: ceiling(numeric); Type: FUNCTION; Schema: public; Owner: postgres
171--
172
173CREATE FUNCTION ceiling(numeric) RETURNS numeric
174    AS '
175    SELECT ceil($1);
176'
177    LANGUAGE sql;
178
179
180--
181-- TOC entry 46 (OID 74304)
182-- Name: log10(double precision); Type: FUNCTION; Schema: public; Owner: postgres
183--
184
185CREATE FUNCTION log10(double precision) RETURNS double precision
186    AS '
187    SELECT log($1);
188'
189    LANGUAGE sql;
190
191
192--
193-- TOC entry 47 (OID 74305)
194-- Name: log10(numeric); Type: FUNCTION; Schema: public; Owner: postgres
195--
196
197CREATE FUNCTION log10(numeric) RETURNS numeric
198    AS '
199    SELECT log($1);
200'
201    LANGUAGE sql;
202
203
204--
205-- TOC entry 48 (OID 74306)
206-- Name: power(double precision, double precision); Type: FUNCTION; Schema: public; Owner: postgres
207--
208
209CREATE FUNCTION power(double precision, double precision) RETURNS double precision
210    AS '
211    SELECT pow($1, $2);
212'
213    LANGUAGE sql;
214
215
216--
217-- TOC entry 49 (OID 74307)
218-- Name: power(numeric, numeric); Type: FUNCTION; Schema: public; Owner: postgres
219--
220
221CREATE FUNCTION power(numeric, numeric) RETURNS numeric
222    AS '
223    SELECT pow($1, $2);
224'
225    LANGUAGE sql;
226
227
228--
229-- TOC entry 50 (OID 74308)
230-- Name: rand(); Type: FUNCTION; Schema: public; Owner: postgres
231--
232
233CREATE FUNCTION rand() RETURNS double precision
234    AS '
235    SELECT random();
236'
237    LANGUAGE sql;
238
239
240--
241-- TOC entry 51 (OID 74309)
242-- Name: rand(double precision); Type: FUNCTION; Schema: public; Owner: postgres
243--
244
245CREATE FUNCTION rand(double precision) RETURNS double precision
246    AS '
247    SELECT setseed($1);
248    SELECT random();
249'
250    LANGUAGE sql;
251
252
253--
254-- TOC entry 52 (OID 74310)
255-- Name: truncate(numeric, integer); Type: FUNCTION; Schema: public; Owner: postgres
256--
257
258CREATE FUNCTION "truncate"(numeric, integer) RETURNS numeric
259    AS '
260    SELECT trunc($1, $2);
261'
262    LANGUAGE sql;
263
264
265--
266-- TOC entry 53 (OID 74311)
267-- Name: curdate(); Type: FUNCTION; Schema: public; Owner: postgres
268--
269
270CREATE FUNCTION curdate() RETURNS date
271    AS '
272    SELECT current_date;
273'
274    LANGUAGE sql;
275
276
277--
278-- TOC entry 54 (OID 74312)
279-- Name: curtime(); Type: FUNCTION; Schema: public; Owner: postgres
280--
281
282CREATE FUNCTION curtime() RETURNS time with time zone
283    AS '
284    SELECT current_time;
285'
286    LANGUAGE sql;
287
288
289--
290-- TOC entry 55 (OID 74313)
291-- Name: odbc_timestamp(); Type: FUNCTION; Schema: public; Owner: postgres
292--
293
294CREATE FUNCTION odbc_timestamp() RETURNS timestamp with time zone
295    AS '
296    SELECT current_timestamp;
297'
298    LANGUAGE sql;
299
300
301--
302-- TOC entry 56 (OID 74314)
303-- Name: dayname(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
304--
305
306CREATE FUNCTION dayname(timestamp without time zone) RETURNS text
307    AS '
308    SELECT to_char($1,''Day'');
309'
310    LANGUAGE sql;
311
312
313--
314-- TOC entry 57 (OID 74315)
315-- Name: dayofmonth(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
316--
317
318CREATE FUNCTION dayofmonth(timestamp without time zone) RETURNS integer
319    AS '
320    SELECT CAST(EXTRACT(day FROM $1) AS integer);
321'
322    LANGUAGE sql;
323
324
325--
326-- TOC entry 58 (OID 74316)
327-- Name: dayofweek(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
328--
329
330CREATE FUNCTION dayofweek(timestamp without time zone) RETURNS integer
331    AS '
332    SELECT CAST(EXTRACT(dow FROM $1) AS integer) + 1;
333'
334    LANGUAGE sql;
335
336
337--
338-- TOC entry 59 (OID 74317)
339-- Name: dayofyear(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
340--
341
342CREATE FUNCTION dayofyear(timestamp without time zone) RETURNS integer
343    AS '
344    SELECT CAST(EXTRACT(doy FROM $1) AS integer);
345'
346    LANGUAGE sql;
347
348
349--
350-- TOC entry 60 (OID 74318)
351-- Name: hour(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
352--
353
354CREATE FUNCTION "hour"(timestamp without time zone) RETURNS integer
355    AS '
356    SELECT CAST(EXTRACT(hour FROM $1) AS integer);
357'
358    LANGUAGE sql;
359
360
361--
362-- TOC entry 61 (OID 74319)
363-- Name: minute(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
364--
365
366CREATE FUNCTION "minute"(timestamp without time zone) RETURNS integer
367    AS '
368    SELECT CAST(EXTRACT(minute FROM $1) AS integer);
369'
370    LANGUAGE sql;
371
372
373--
374-- TOC entry 62 (OID 74320)
375-- Name: month(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
376--
377
378CREATE FUNCTION "month"(timestamp without time zone) RETURNS integer
379    AS '
380    SELECT CAST(EXTRACT(month FROM $1) AS integer);
381'
382    LANGUAGE sql;
383
384
385--
386-- TOC entry 63 (OID 74321)
387-- Name: monthname(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
388--
389
390CREATE FUNCTION monthname(timestamp without time zone) RETURNS text
391    AS '
392    SELECT to_char($1, ''Month'');
393'
394    LANGUAGE sql;
395
396
397--
398-- TOC entry 64 (OID 74322)
399-- Name: quarter(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
400--
401
402CREATE FUNCTION quarter(timestamp without time zone) RETURNS integer
403    AS '
404    SELECT CAST(EXTRACT(quarter FROM $1) AS integer);
405'
406    LANGUAGE sql;
407
408
409--
410-- TOC entry 65 (OID 74323)
411-- Name: second(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
412--
413
414CREATE FUNCTION "second"(timestamp without time zone) RETURNS integer
415    AS '
416    SELECT CAST(EXTRACT(second FROM $1) AS integer);
417'
418    LANGUAGE sql;
419
420
421--
422-- TOC entry 66 (OID 74324)
423-- Name: week(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
424--
425
426CREATE FUNCTION week(timestamp without time zone) RETURNS integer
427    AS '
428    SELECT CAST(EXTRACT(week FROM $1) AS integer);
429'
430    LANGUAGE sql;
431
432
433--
434-- TOC entry 67 (OID 74325)
435-- Name: year(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
436--
437
438CREATE FUNCTION "year"(timestamp without time zone) RETURNS integer
439    AS '
440    SELECT CAST(EXTRACT(year FROM $1) AS integer);
441'
442    LANGUAGE sql;
443
444
445--
446-- TOC entry 68 (OID 74326)
447-- Name: odbc_user(); Type: FUNCTION; Schema: public; Owner: postgres
448--
449
450CREATE FUNCTION odbc_user() RETURNS text
451    AS '
452    SELECT CAST(current_user AS TEXT);
453'
454    LANGUAGE sql;
455
456
457--
458-- TOC entry 69 (OID 74327)
459-- Name: odbc_current_user(); Type: FUNCTION; Schema: public; Owner: postgres
460--
461
462CREATE FUNCTION odbc_current_user() RETURNS text
463    AS '
464    SELECT CAST(current_user AS TEXT);
465'
466    LANGUAGE sql;
467
468
469--
470-- TOC entry 70 (OID 74328)
471-- Name: odbc_session_user(); Type: FUNCTION; Schema: public; Owner: postgres
472--
473
474CREATE FUNCTION odbc_session_user() RETURNS text
475    AS '
476    SELECT CAST(session_user AS TEXT);
477'
478    LANGUAGE sql;
479
480
481SET SESSION AUTHORIZATION 'toni';
482
483--
484-- TOC entry 5 (OID 114993)
485-- Name: waeup_usedscratchcards; Type: TABLE; Schema: public; Owner: toni
486--
487
488CREATE TABLE waeup_usedscratchcards (
489    pin character(16) NOT NULL,
490    sold timestamp without time zone,
491    bank character varying(30),
492    used_by character(16) NOT NULL,
493    used_on timestamp without time zone NOT NULL,
494    used_for character varying(20) NOT NULL
495);
496
497
498--
499-- TOC entry 6 (OID 114993)
500-- Name: waeup_usedscratchcards; Type: ACL; Schema: public; Owner: toni
501--
502
503REVOKE ALL ON TABLE waeup_usedscratchcards FROM PUBLIC;
504GRANT ALL ON TABLE waeup_usedscratchcards TO imke;
505
506
507SET SESSION AUTHORIZATION 'toni';
508
509--
510-- TOC entry 7 (OID 115157)
511-- Name: waeup_scratchcard; Type: TABLE; Schema: public; Owner: toni
512--
513
514CREATE TABLE waeup_scratchcard (
515    pin character varying(16) NOT NULL,
516    value integer NOT NULL,
517    used_by character varying(16),
518    used_on timestamp with time zone,
519    used_for character varying(20)
520);
521
522
523--
524-- TOC entry 8 (OID 115157)
525-- Name: waeup_scratchcard; Type: ACL; Schema: public; Owner: toni
526--
527
528REVOKE ALL ON TABLE waeup_scratchcard FROM PUBLIC;
529GRANT ALL ON TABLE waeup_scratchcard TO imke;
530
531
532SET SESSION AUTHORIZATION 'toni';
533
534--
535-- TOC entry 9 (OID 123388)
536-- Name: waeup_jamb_student; Type: TABLE; Schema: public; Owner: toni
537--
538
539CREATE TABLE waeup_jamb_student (
540    fname character varying(64) NOT NULL,
541    lname character varying(64) NOT NULL,
542    bdate date NOT NULL,
543    gender character(1) NOT NULL,
544    studentid character(16) NOT NULL,
545    course_of_study character varying(100),
546    faculty character varying(100) NOT NULL,
547    state_of_origin character varying(100) NOT NULL,
548    mark_english integer,
549    subject2 character(32),
550    subject2marks integer,
551    subject1 character(32),
552    subject1marks integer,
553    subject3 character(32),
554    subject3marks integer,
555    CONSTRAINT waeup_jamb_student_gender CHECK (((gender = 'm'::bpchar) OR (gender = 'f'::bpchar)))
556);
557
558
559--
560-- TOC entry 10 (OID 123388)
561-- Name: waeup_jamb_student; Type: ACL; Schema: public; Owner: toni
562--
563
564REVOKE ALL ON TABLE waeup_jamb_student FROM PUBLIC;
565GRANT ALL ON TABLE waeup_jamb_student TO imke;
566
567
568SET SESSION AUTHORIZATION 'toni';
569
570--
571-- TOC entry 11 (OID 123393)
572-- Name: waeup_student; Type: TABLE; Schema: public; Owner: toni
573--
574
575CREATE TABLE waeup_student (
576    studentid character(16) NOT NULL,
577    matno character varying(20) NOT NULL,
578    "password" character varying(35),
579    clearance_on date,
580    housing timestamp without time zone,
581    school_fee timestamp without time zone
582);
583
584
585--
586-- TOC entry 12 (OID 123393)
587-- Name: waeup_student; Type: ACL; Schema: public; Owner: toni
588--
589
590REVOKE ALL ON TABLE waeup_student FROM PUBLIC;
591GRANT ALL ON TABLE waeup_student TO imke;
592
593
594SET SESSION AUTHORIZATION 'toni';
595
596--
597-- TOC entry 13 (OID 123406)
598-- Name: waeup_acc_house; Type: TABLE; Schema: public; Owner: toni
599--
600
601CREATE TABLE waeup_acc_house (
602    house character varying(30) NOT NULL,
603    gender character(1) NOT NULL,
604    beds integer NOT NULL,
605    CONSTRAINT waeup_acc_house_beds CHECK ((beds > 0))
606);
607
608
609--
610-- TOC entry 14 (OID 123406)
611-- Name: waeup_acc_house; Type: ACL; Schema: public; Owner: toni
612--
613
614REVOKE ALL ON TABLE waeup_acc_house FROM PUBLIC;
615GRANT ALL ON TABLE waeup_acc_house TO imke;
616
617
618SET SESSION AUTHORIZATION 'toni';
619
620--
621-- TOC entry 15 (OID 123411)
622-- Name: waeup_acc_floor; Type: TABLE; Schema: public; Owner: toni
623--
624
625CREATE TABLE waeup_acc_floor (
626    floorno integer NOT NULL,
627    house character varying(30) NOT NULL,
628    gender character(1) NOT NULL,
629    rooms integer NOT NULL
630);
631
632
633--
634-- TOC entry 16 (OID 123411)
635-- Name: waeup_acc_floor; Type: ACL; Schema: public; Owner: toni
636--
637
638REVOKE ALL ON TABLE waeup_acc_floor FROM PUBLIC;
639GRANT ALL ON TABLE waeup_acc_floor TO imke;
640
641
642SET SESSION AUTHORIZATION 'toni';
643
644--
645-- TOC entry 17 (OID 123435)
646-- Name: waeup_acc_bedlist; Type: TABLE; Schema: public; Owner: toni
647--
648
649CREATE TABLE waeup_acc_bedlist (
650    house character varying(30) NOT NULL,
651    floor integer NOT NULL,
652    room integer NOT NULL,
653    bed integer NOT NULL,
654    gender character(1) NOT NULL,
655    used_by character varying(16),
656    CONSTRAINT waeup_acc_bedlist_bed CHECK ((bed > 0)),
657    CONSTRAINT waeup_acc_bedlist_gender CHECK (((gender = 'm'::bpchar) OR (gender = 'f'::bpchar))),
658    CONSTRAINT waeup_acc_bedlist_room CHECK ((room > 0))
659);
660
661
662--
663-- TOC entry 18 (OID 123435)
664-- Name: waeup_acc_bedlist; Type: ACL; Schema: public; Owner: toni
665--
666
667REVOKE ALL ON TABLE waeup_acc_bedlist FROM PUBLIC;
668GRANT ALL ON TABLE waeup_acc_bedlist TO imke;
669
670
671SET SESSION AUTHORIZATION 'toni';
672
673--
674-- TOC entry 19 (OID 123450)
675-- Name: waeup_acc_bed; Type: VIEW; Schema: public; Owner: toni
676--
677
678CREATE VIEW waeup_acc_bed AS
679    SELECT h.house, bl.floor, bl.room, bl.bed, h.gender FROM waeup_acc_house h, waeup_acc_bedlist bl WHERE ((h.house)::text = (bl.house)::text);
680
681
682--
683-- TOC entry 20 (OID 123450)
684-- Name: waeup_acc_bed; Type: ACL; Schema: public; Owner: toni
685--
686
687REVOKE ALL ON TABLE waeup_acc_bed FROM PUBLIC;
688GRANT ALL ON TABLE waeup_acc_bed TO imke;
689
690
691SET SESSION AUTHORIZATION 'toni';
692
693--
694-- TOC entry 21 (OID 123451)
695-- Name: waeup_faculties; Type: TABLE; Schema: public; Owner: toni
696--
697
698CREATE TABLE waeup_faculties (
699    faculty character varying(30) NOT NULL,
700    school_fee integer NOT NULL,
701    CONSTRAINT school_fee CHECK ((school_fee >= 0))
702);
703
704
705--
706-- TOC entry 22 (OID 123451)
707-- Name: waeup_faculties; Type: ACL; Schema: public; Owner: toni
708--
709
710REVOKE ALL ON TABLE waeup_faculties FROM PUBLIC;
711GRANT ALL ON TABLE waeup_faculties TO imke;
712
713
714SET SESSION AUTHORIZATION 'toni';
715
716--
717-- TOC entry 23 (OID 123828)
718-- Name: waeup_course; Type: TABLE; Schema: public; Owner: toni
719--
720
721CREATE TABLE waeup_course (
722    faculty character varying(30),
723    title character varying(60) NOT NULL,
724    courseno character varying(10) NOT NULL,
725    workload integer NOT NULL,
726    CONSTRAINT waeup_course_workload CHECK ((workload >= 0))
727);
728
729
730--
731-- TOC entry 24 (OID 123837)
732-- Name: waeup_courseentry; Type: TABLE; Schema: public; Owner: toni
733--
734
735CREATE TABLE waeup_courseentry (
736    courseno character varying(10),
737    e integer NOT NULL,
738    s1 character(4) NOT NULL,
739    m1 integer NOT NULL,
740    s2 character(4) NOT NULL,
741    m2 integer NOT NULL,
742    s3 character(4) NOT NULL,
743    m3 integer NOT NULL,
744    CONSTRAINT waeup_courseentry_e CHECK ((e >= 0)),
745    CONSTRAINT waeup_courseentry_m1 CHECK ((m1 >= 0)),
746    CONSTRAINT waeup_courseentry_m2 CHECK ((m2 >= 0)),
747    CONSTRAINT waeup_courseentry_m3 CHECK ((m3 >= 0))
748);
749
750
751--
752-- TOC entry 25 (OID 114995)
753-- Name: waeup_usedscratchcards_pkey; Type: CONSTRAINT; Schema: public; Owner: toni
754--
755
756ALTER TABLE ONLY waeup_usedscratchcards
757    ADD CONSTRAINT waeup_usedscratchcards_pkey PRIMARY KEY (pin);
758
759
760--
761-- TOC entry 26 (OID 115159)
762-- Name: waeup_scratchcard_pkey; Type: CONSTRAINT; Schema: public; Owner: toni
763--
764
765ALTER TABLE ONLY waeup_scratchcard
766    ADD CONSTRAINT waeup_scratchcard_pkey PRIMARY KEY (pin);
767
768
769--
770-- TOC entry 27 (OID 123391)
771-- Name: waeup_jamb_student_studentid_key; Type: CONSTRAINT; Schema: public; Owner: toni
772--
773
774ALTER TABLE ONLY waeup_jamb_student
775    ADD CONSTRAINT waeup_jamb_student_studentid_key UNIQUE (studentid);
776
777
778--
779-- TOC entry 29 (OID 123398)
780-- Name: waeup_student_studentid_key; Type: CONSTRAINT; Schema: public; Owner: toni
781--
782
783ALTER TABLE ONLY waeup_student
784    ADD CONSTRAINT waeup_student_studentid_key UNIQUE (studentid);
785
786
787--
788-- TOC entry 28 (OID 123400)
789-- Name: waeup_student_matno_key; Type: CONSTRAINT; Schema: public; Owner: toni
790--
791
792ALTER TABLE ONLY waeup_student
793    ADD CONSTRAINT waeup_student_matno_key UNIQUE (matno);
794
795
796--
797-- TOC entry 30 (OID 123409)
798-- Name: waeup_acc_house_house_key; Type: CONSTRAINT; Schema: public; Owner: toni
799--
800
801ALTER TABLE ONLY waeup_acc_house
802    ADD CONSTRAINT waeup_acc_house_house_key UNIQUE (house);
803
804
805--
806-- TOC entry 31 (OID 123453)
807-- Name: waeup_faculties_faculty_key; Type: CONSTRAINT; Schema: public; Owner: toni
808--
809
810ALTER TABLE ONLY waeup_faculties
811    ADD CONSTRAINT waeup_faculties_faculty_key UNIQUE (faculty);
812
813
814--
815-- TOC entry 32 (OID 123831)
816-- Name: waeup_course_courseno_key; Type: CONSTRAINT; Schema: public; Owner: toni
817--
818
819ALTER TABLE ONLY waeup_course
820    ADD CONSTRAINT waeup_course_courseno_key UNIQUE (courseno);
821
822
823--
824-- TOC entry 71 (OID 123402)
825-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: toni
826--
827
828ALTER TABLE ONLY waeup_student
829    ADD CONSTRAINT "$1" FOREIGN KEY (studentid) REFERENCES waeup_jamb_student(studentid);
830
831
832--
833-- TOC entry 72 (OID 123413)
834-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: toni
835--
836
837ALTER TABLE ONLY waeup_acc_floor
838    ADD CONSTRAINT "$1" FOREIGN KEY (house) REFERENCES waeup_acc_house(house);
839
840
841--
842-- TOC entry 73 (OID 123444)
843-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: toni
844--
845
846ALTER TABLE ONLY waeup_acc_bedlist
847    ADD CONSTRAINT "$2" FOREIGN KEY (used_by) REFERENCES waeup_student(matno);
848
849
850--
851-- TOC entry 74 (OID 123833)
852-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: toni
853--
854
855ALTER TABLE ONLY waeup_course
856    ADD CONSTRAINT "$1" FOREIGN KEY (faculty) REFERENCES waeup_faculties(faculty);
857
858
859--
860-- TOC entry 75 (OID 123843)
861-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: toni
862--
863
864ALTER TABLE ONLY waeup_courseentry
865    ADD CONSTRAINT "$1" FOREIGN KEY (courseno) REFERENCES waeup_course(courseno);
866
867
868SET SESSION AUTHORIZATION 'postgres';
869
870--
871-- TOC entry 3 (OID 2200)
872-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
873--
874
875COMMENT ON SCHEMA public IS 'Standard public namespace';
876
877
Note: See TracBrowser for help on using the repository browser.