source: ether_eccad/trunk/ECCAD_INTERFACE/pinaud_save_eccad.sql @ 68

Last change on this file since 68 was 68, checked in by cbipsl, 14 years ago

commit v1 eccad

  • Property svn:executable set to *
File size: 27.3 KB
Line 
1--
2-- PostgreSQL database dump
3--
4
5SET client_encoding = 'LATIN1';
6SET check_function_bodies = false;
7SET client_min_messages = warning;
8
9--
10-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
11--
12
13COMMENT ON SCHEMA public IS 'Standard public schema';
14
15
16--
17-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner:
18--
19
20CREATE PROCEDURAL LANGUAGE plpgsql;
21
22
23--
24-- Name: pltcl; Type: PROCEDURAL LANGUAGE; Schema: -; Owner:
25--
26
27CREATE PROCEDURAL LANGUAGE pltcl;
28
29
30SET search_path = public, pg_catalog;
31
32--
33-- Name: __infosgrille; Type: TYPE; Schema: public; Owner: wwwadm
34--
35
36CREATE TYPE __infosgrille AS (
37        id_grille integer,
38        id_sequence integer,
39        id_produit integer,
40        id_codification integer,
41        id_param integer,
42        valeurs_grille oid,
43        date_grille date,
44        deltadate_grille interval,
45        ncol_grille integer,
46        nlign_grille integer,
47        level_grille double precision,
48        legend_code character varying(128)
49);
50
51
52ALTER TYPE public.__infosgrille OWNER TO wwwadm;
53
54--
55-- Name: date_updater(); Type: FUNCTION; Schema: public; Owner: wwwadm
56--
57
58CREATE FUNCTION date_updater() RETURNS "trigger"
59    AS $$
60   DECLARE
61   date_max date;
62   date_min date;
63   date_cur date;
64   BEGIN
65   SELECT INTO date_max endtime_produit FROM produit WHERE id_produit=NEW.id_produit;
66   SELECT INTO date_min begintime_produit FROM produit WHERE id_produit=NEW.id_produit;
67   date_cur := NEW.DATE_GRILLE;
68
69   IF date_cur <= date_max THEN
70   ELSE
71       UPDATE produit SET endtime_produit=date_cur WHERE id_produit=NEW.id_produit;
72   END IF;
73
74   IF date_cur >= date_min THEN
75   ELSE
76       UPDATE produit SET begintime_produit=date_cur WHERE id_produit=NEW.id_produit;
77   END IF;
78
79       RETURN NULL;
80   END;
81$$
82    LANGUAGE plpgsql;
83
84
85ALTER FUNCTION public.date_updater() OWNER TO wwwadm;
86
87--
88-- Name: extractinfos(integer, integer, date, date); Type: FUNCTION; Schema: public; Owner: wwwadm
89--
90
91CREATE FUNCTION extractinfos(integer, integer, date, date) RETURNS SETOF __infosgrille
92    AS $_$
93SELECT  id_grille, id_sequence, id_produit, grille.id_codification, id_param, valeurs_grille, date_grille, deltaDate_grille, ncol_grille, nlign_grille, level_grille, legend_code FROM grille JOIN code ON (id_grille = num_code AND grille.id_codification = code.id_codification)  WHERE id_param = $2 AND id_produit = $1 AND date_grille >= $3 AND date_grille <= $4 ORDER BY date_grille, legend_code;
94$_$
95    LANGUAGE sql;
96
97
98ALTER FUNCTION public.extractinfos(integer, integer, date, date) OWNER TO wwwadm;
99
100SET default_tablespace = '';
101
102SET default_with_oids = false;
103
104--
105-- Name: REFERENCES; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
106--
107
108CREATE TABLE "REFERENCES" (
109    id_references serial NOT NULL,
110    pubtitle_references text NOT NULL,
111    puburl_references character varying(128),
112    pubeditor_references text,
113    pubyear_references character varying(128),
114    pubauthors_references text,
115    journal_references text,
116    volum_references character varying(128),
117    page_references character varying(128),
118    status_references character varying(128),
119    abstract_references text,
120    number_references character varying(128)
121);
122
123
124ALTER TABLE public."REFERENCES" OWNER TO wwwadm;
125
126--
127-- Name: categorieparametre; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
128--
129
130CREATE TABLE categorieparametre (
131    id_categorieparametre serial NOT NULL,
132    fullname_categorieparametre character varying(128) NOT NULL,
133    shortname_categorieparametre character varying(128)
134);
135
136
137ALTER TABLE public.categorieparametre OWNER TO wwwadm;
138
139--
140-- Name: code; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
141--
142
143CREATE TABLE code (
144    id_code serial NOT NULL,
145    id_codification integer NOT NULL,
146    num_code integer NOT NULL,
147    legend_code character varying(128) NOT NULL
148);
149
150
151ALTER TABLE public.code OWNER TO wwwadm;
152
153--
154-- Name: codification; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
155--
156
157CREATE TABLE codification (
158    id_codification serial NOT NULL,
159    id_typecodification integer,
160    nom_codification character varying(128),
161    comment_codification character varying(128)
162);
163
164
165ALTER TABLE public.codification OWNER TO wwwadm;
166
167--
168-- Name: color; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
169--
170
171CREATE TABLE color (
172    col_id serial NOT NULL,
173    col_r integer,
174    col_g integer,
175    col_b integer
176);
177
178
179ALTER TABLE public.color OWNER TO wwwadm;
180
181--
182-- Name: color_index; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
183--
184
185CREATE TABLE color_index (
186    cm_id integer NOT NULL,
187    col_id integer NOT NULL,
188    ci_max double precision NOT NULL
189);
190
191
192ALTER TABLE public.color_index OWNER TO wwwadm;
193
194--
195-- Name: colormap; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
196--
197
198CREATE TABLE colormap (
199    cm_id serial NOT NULL,
200    cm_name character varying(50)
201);
202
203
204ALTER TABLE public.colormap OWNER TO wwwadm;
205
206--
207-- Name: concerne; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
208--
209
210CREATE TABLE concerne (
211    id_produit integer NOT NULL,
212    id_references integer NOT NULL
213);
214
215
216ALTER TABLE public.concerne OWNER TO wwwadm;
217
218--
219-- Name: domaine; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
220--
221
222CREATE TABLE domaine (
223    id_domaine serial NOT NULL,
224    lonmin_domaine double precision NOT NULL,
225    lonmax_domaine double precision NOT NULL,
226    latmin_domaine double precision NOT NULL,
227    latmax_domaine double precision NOT NULL
228);
229
230
231ALTER TABLE public.domaine OWNER TO wwwadm;
232
233--
234-- Name: fichier; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
235--
236
237CREATE TABLE fichier (
238    id_fichier serial NOT NULL,
239    id_produit integer NOT NULL,
240    name_fichier character varying(128) NOT NULL,
241    date_fichier timestamp without time zone NOT NULL,
242    state_fichier character varying(128) NOT NULL
243);
244
245
246ALTER TABLE public.fichier OWNER TO wwwadm;
247
248--
249-- Name: grille; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
250--
251
252CREATE TABLE grille (
253    id_grille serial NOT NULL,
254    id_sequence integer,
255    id_produit integer,
256    id_codification integer,
257    id_param integer,
258    valeurs_grille oid,
259    date_grille date,
260    deltadate_grille interval,
261    ncol_grille integer,
262    nlign_grille integer,
263    level_grille double precision
264);
265
266
267ALTER TABLE public.grille OWNER TO wwwadm;
268
269--
270-- Name: TABLE grille; Type: COMMENT; Schema: public; Owner: wwwadm
271--
272
273COMMENT ON TABLE grille IS 'Delta date fournit, l''intervalle de cumul, de moyenne ......
274le type d''aggrégation est fournit par le type de la grille
275Date est la fin de cette période
276
277ValeursGrille est un tableau à deux dimensions 720x360 par defaut
278les valeurs sont entieres et comprimées via le min/max du parametre de la grille
279    v= min + v -min /max-min';
280
281
282--
283-- Name: organisme; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
284--
285
286CREATE TABLE organisme (
287    id_organisme serial NOT NULL,
288    fullname_organisme character varying(128) NOT NULL,
289    shortname_organisme character varying(128),
290    phone_organisme character varying(128),
291    fax_organisme character varying(128),
292    url_organisme character varying(128),
293    address_organisme character varying(128),
294    zipcode_organisme character varying(128),
295    city_organisme character varying(128),
296    country_organisme character varying(128)
297);
298
299
300ALTER TABLE public.organisme OWNER TO wwwadm;
301
302--
303-- Name: param_color; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
304--
305
306CREATE TABLE param_color (
307    cm_id integer NOT NULL,
308    id_param integer NOT NULL,
309    pc_defaut integer
310);
311
312
313ALTER TABLE public.param_color OWNER TO wwwadm;
314
315--
316-- Name: parametre; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
317--
318
319CREATE TABLE parametre (
320    id_param serial NOT NULL,
321    id_categorieparametre integer,
322    id_unite integer,
323    fullname_param character varying(128) NOT NULL,
324    shortname_param character varying(128),
325    min_param character varying(128),
326    max_param character varying(128)
327);
328
329
330ALTER TABLE public.parametre OWNER TO wwwadm;
331
332--
333-- Name: personne; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
334--
335
336CREATE TABLE personne (
337    id_personne serial NOT NULL,
338    id_organisme integer,
339    lastname_personne character varying(128) NOT NULL,
340    firstname_personne character varying(128) NOT NULL,
341    email_personne character varying(128) NOT NULL,
342    phone_personne character varying(128),
343    fax_personne character varying(128)
344);
345
346
347ALTER TABLE public.personne OWNER TO wwwadm;
348
349--
350-- Name: produit; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
351--
352
353CREATE TABLE produit (
354    id_produit serial NOT NULL,
355    id_produitorig integer,
356    id_contacttech integer,
357    id_contactthem integer,
358    id_contactbase integer,
359    id_domaine integer,
360    id_organisme integer,
361    title_produit character varying(128) NOT NULL,
362    description_produit text,
363    begintime_produit date,
364    endtime_produit date,
365    temporalres_produit character varying(128),
366    spatialres_produit character varying(128),
367    textcitation_produit text,
368    informpub_produit text,
369    annotationcitation_produit text
370);
371
372
373ALTER TABLE public.produit OWNER TO wwwadm;
374
375--
376-- Name: produitorig; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
377--
378
379CREATE TABLE produitorig (
380    id_produitorig serial NOT NULL,
381    title_produitorig character varying(128) NOT NULL,
382    temporalres_produitorig character varying(128),
383    spatialres_produitorig character varying(128),
384    projection_produitorig character varying(128),
385    method_produitorig text,
386    dataurl_produitorig character varying(128),
387    documentation_produitorig character varying(128)[]
388);
389
390
391ALTER TABLE public.produitorig OWNER TO wwwadm;
392
393--
394-- Name: requete; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
395--
396
397CREATE TABLE requete (
398    id_requete serial NOT NULL,
399    date_requete character varying(128),
400    contained_requete text,
401    userlastname_requete character varying(128),
402    userfirstname_requete character varying(128),
403    useremail_requete character varying(128)
404);
405
406
407ALTER TABLE public.requete OWNER TO wwwadm;
408
409--
410-- Name: sequence; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
411--
412
413CREATE TABLE "sequence" (
414    id_sequence serial NOT NULL,
415    comment_sequence character varying(128)
416);
417
418
419ALTER TABLE public."sequence" OWNER TO wwwadm;
420
421--
422-- Name: typecodification; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
423--
424
425CREATE TABLE typecodification (
426    id_typecodification serial NOT NULL,
427    name_typecodification character varying(128),
428    comment_typecodification character varying(128)
429);
430
431
432ALTER TABLE public.typecodification OWNER TO wwwadm;
433
434--
435-- Name: unite; Type: TABLE; Schema: public; Owner: wwwadm; Tablespace:
436--
437
438CREATE TABLE unite (
439    id_unite serial NOT NULL,
440    fullname_unite character varying(128) NOT NULL,
441    shortname_unite character varying(128) NOT NULL
442);
443
444
445ALTER TABLE public.unite OWNER TO wwwadm;
446
447--
448-- Name: ak_cle_2_domaine; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
449--
450
451ALTER TABLE ONLY domaine
452    ADD CONSTRAINT ak_cle_2_domaine UNIQUE (lonmin_domaine, lonmax_domaine, latmin_domaine, latmax_domaine);
453
454
455--
456-- Name: ak_cle_2_organism; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
457--
458
459ALTER TABLE ONLY organisme
460    ADD CONSTRAINT ak_cle_2_organism UNIQUE (fullname_organisme);
461
462
463--
464-- Name: ak_cle_2_personne; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
465--
466
467ALTER TABLE ONLY personne
468    ADD CONSTRAINT ak_cle_2_personne UNIQUE (lastname_personne, email_personne);
469
470
471--
472-- Name: ak_cle_2_produit; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
473--
474
475ALTER TABLE ONLY produit
476    ADD CONSTRAINT ak_cle_2_produit UNIQUE (title_produit);
477
478
479--
480-- Name: ak_cle_2_produito; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
481--
482
483ALTER TABLE ONLY produitorig
484    ADD CONSTRAINT ak_cle_2_produito UNIQUE (title_produitorig);
485
486
487--
488-- Name: color_col_r_key; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
489--
490
491ALTER TABLE ONLY color
492    ADD CONSTRAINT color_col_r_key UNIQUE (col_r, col_g, col_b);
493
494
495--
496-- Name: color_index_pkey; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
497--
498
499ALTER TABLE ONLY color_index
500    ADD CONSTRAINT color_index_pkey PRIMARY KEY (cm_id, col_id, ci_max);
501
502
503--
504-- Name: color_pkey; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
505--
506
507ALTER TABLE ONLY color
508    ADD CONSTRAINT color_pkey PRIMARY KEY (col_id);
509
510
511--
512-- Name: colormap_cm_name_key; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
513--
514
515ALTER TABLE ONLY colormap
516    ADD CONSTRAINT colormap_cm_name_key UNIQUE (cm_name);
517
518
519--
520-- Name: colormap_pkey; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
521--
522
523ALTER TABLE ONLY colormap
524    ADD CONSTRAINT colormap_pkey PRIMARY KEY (cm_id);
525
526
527--
528-- Name: param_color_pkey; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
529--
530
531ALTER TABLE ONLY param_color
532    ADD CONSTRAINT param_color_pkey PRIMARY KEY (cm_id, id_param);
533
534
535--
536-- Name: pk_categorieparametre; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
537--
538
539ALTER TABLE ONLY categorieparametre
540    ADD CONSTRAINT pk_categorieparametre PRIMARY KEY (id_categorieparametre);
541
542
543--
544-- Name: pk_code; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
545--
546
547ALTER TABLE ONLY code
548    ADD CONSTRAINT pk_code PRIMARY KEY (id_code);
549
550
551--
552-- Name: pk_codification; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
553--
554
555ALTER TABLE ONLY codification
556    ADD CONSTRAINT pk_codification PRIMARY KEY (id_codification);
557
558
559--
560-- Name: pk_concerne; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
561--
562
563ALTER TABLE ONLY concerne
564    ADD CONSTRAINT pk_concerne PRIMARY KEY (id_produit, id_references);
565
566
567--
568-- Name: pk_domaine; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
569--
570
571ALTER TABLE ONLY domaine
572    ADD CONSTRAINT pk_domaine PRIMARY KEY (id_domaine);
573
574
575--
576-- Name: pk_fichier; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
577--
578
579ALTER TABLE ONLY fichier
580    ADD CONSTRAINT pk_fichier PRIMARY KEY (id_fichier);
581
582
583--
584-- Name: pk_grille; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
585--
586
587ALTER TABLE ONLY grille
588    ADD CONSTRAINT pk_grille PRIMARY KEY (id_grille);
589
590
591--
592-- Name: pk_organisme; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
593--
594
595ALTER TABLE ONLY organisme
596    ADD CONSTRAINT pk_organisme PRIMARY KEY (id_organisme);
597
598
599--
600-- Name: pk_parametre; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
601--
602
603ALTER TABLE ONLY parametre
604    ADD CONSTRAINT pk_parametre PRIMARY KEY (id_param);
605
606
607--
608-- Name: pk_personne; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
609--
610
611ALTER TABLE ONLY personne
612    ADD CONSTRAINT pk_personne PRIMARY KEY (id_personne);
613
614
615--
616-- Name: pk_produit; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
617--
618
619ALTER TABLE ONLY produit
620    ADD CONSTRAINT pk_produit PRIMARY KEY (id_produit);
621
622
623--
624-- Name: pk_produitorig; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
625--
626
627ALTER TABLE ONLY produitorig
628    ADD CONSTRAINT pk_produitorig PRIMARY KEY (id_produitorig);
629
630
631--
632-- Name: pk_references; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
633--
634
635ALTER TABLE ONLY "REFERENCES"
636    ADD CONSTRAINT pk_references PRIMARY KEY (id_references);
637
638
639--
640-- Name: pk_requete; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
641--
642
643ALTER TABLE ONLY requete
644    ADD CONSTRAINT pk_requete PRIMARY KEY (id_requete);
645
646
647--
648-- Name: pk_sequence; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
649--
650
651ALTER TABLE ONLY "sequence"
652    ADD CONSTRAINT pk_sequence PRIMARY KEY (id_sequence);
653
654
655--
656-- Name: pk_typecodification; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
657--
658
659ALTER TABLE ONLY typecodification
660    ADD CONSTRAINT pk_typecodification PRIMARY KEY (id_typecodification);
661
662
663--
664-- Name: pk_unite; Type: CONSTRAINT; Schema: public; Owner: wwwadm; Tablespace:
665--
666
667ALTER TABLE ONLY unite
668    ADD CONSTRAINT pk_unite PRIMARY KEY (id_unite);
669
670
671--
672-- Name: _references__pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
673--
674
675CREATE UNIQUE INDEX _references__pk ON "REFERENCES" USING btree (id_references);
676
677
678--
679-- Name: appartient_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
680--
681
682CREATE INDEX appartient_fk ON grille USING btree (id_sequence);
683
684
685--
686-- Name: appartienta_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
687--
688
689CREATE INDEX appartienta_fk ON personne USING btree (id_organisme);
690
691
692--
693-- Name: categorieparametre_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
694--
695
696CREATE UNIQUE INDEX categorieparametre_pk ON categorieparametre USING btree (id_categorieparametre);
697
698
699--
700-- Name: code_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
701--
702
703CREATE UNIQUE INDEX code_pk ON code USING btree (id_code);
704
705
706--
707-- Name: codification_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
708--
709
710CREATE UNIQUE INDEX codification_pk ON codification USING btree (id_codification);
711
712
713--
714-- Name: concerne2_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
715--
716
717CREATE INDEX concerne2_fk ON concerne USING btree (id_references);
718
719
720--
721-- Name: concerne_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
722--
723
724CREATE INDEX concerne_fk ON concerne USING btree (id_produit);
725
726
727--
728-- Name: concerne_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
729--
730
731CREATE UNIQUE INDEX concerne_pk ON concerne USING btree (id_produit, id_references);
732
733
734--
735-- Name: contactdatabase_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
736--
737
738CREATE INDEX contactdatabase_fk ON produit USING btree (id_contactthem);
739
740
741--
742-- Name: contacttechnique_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
743--
744
745CREATE INDEX contacttechnique_fk ON produit USING btree (id_contactbase);
746
747
748--
749-- Name: contactthematique_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
750--
751
752CREATE INDEX contactthematique_fk ON produit USING btree (id_contacttech);
753
754
755--
756-- Name: contient_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
757--
758
759CREATE INDEX contient_fk ON fichier USING btree (id_produit);
760
761
762--
763-- Name: contientlescodes_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
764--
765
766CREATE INDEX contientlescodes_fk ON code USING btree (id_codification);
767
768
769--
770-- Name: contientlesgrilles_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
771--
772
773CREATE INDEX contientlesgrilles_fk ON grille USING btree (id_produit);
774
775
776--
777-- Name: decategorie_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
778--
779
780CREATE INDEX decategorie_fk ON parametre USING btree (id_categorieparametre);
781
782
783--
784-- Name: deparametre_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
785--
786
787CREATE INDEX deparametre_fk ON grille USING btree (id_param);
788
789
790--
791-- Name: detype_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
792--
793
794CREATE INDEX detype_fk ON codification USING btree (id_typecodification);
795
796
797--
798-- Name: domaine_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
799--
800
801CREATE UNIQUE INDEX domaine_pk ON domaine USING btree (id_domaine);
802
803
804--
805-- Name: dunite_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
806--
807
808CREATE INDEX dunite_fk ON parametre USING btree (id_unite);
809
810
811--
812-- Name: est_code_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
813--
814
815CREATE INDEX est_code_fk ON grille USING btree (id_codification);
816
817
818--
819-- Name: fichier_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
820--
821
822CREATE UNIQUE INDEX fichier_pk ON fichier USING btree (id_fichier);
823
824
825--
826-- Name: fournitpar_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
827--
828
829CREATE INDEX fournitpar_fk ON produit USING btree (id_organisme);
830
831
832--
833-- Name: grille_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
834--
835
836CREATE UNIQUE INDEX grille_pk ON grille USING btree (id_grille);
837
838
839--
840-- Name: organisme_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
841--
842
843CREATE UNIQUE INDEX organisme_pk ON organisme USING btree (id_organisme);
844
845
846--
847-- Name: origine2_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
848--
849
850CREATE INDEX origine2_fk ON produit USING btree (id_produitorig);
851
852
853--
854-- Name: parametre_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
855--
856
857CREATE UNIQUE INDEX parametre_pk ON parametre USING btree (id_param);
858
859
860--
861-- Name: personne_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
862--
863
864CREATE UNIQUE INDEX personne_pk ON personne USING btree (id_personne);
865
866
867--
868-- Name: produit_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
869--
870
871CREATE UNIQUE INDEX produit_pk ON produit USING btree (id_produit);
872
873
874--
875-- Name: produitorig_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
876--
877
878CREATE UNIQUE INDEX produitorig_pk ON produitorig USING btree (id_produitorig);
879
880
881--
882-- Name: sequence_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
883--
884
885CREATE UNIQUE INDEX sequence_pk ON "sequence" USING btree (id_sequence);
886
887
888--
889-- Name: surledomaine_fk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
890--
891
892CREATE INDEX surledomaine_fk ON produit USING btree (id_domaine);
893
894
895--
896-- Name: typecodification_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
897--
898
899CREATE UNIQUE INDEX typecodification_pk ON typecodification USING btree (id_typecodification);
900
901
902--
903-- Name: unite_pk; Type: INDEX; Schema: public; Owner: wwwadm; Tablespace:
904--
905
906CREATE UNIQUE INDEX unite_pk ON unite USING btree (id_unite);
907
908
909--
910-- Name: date_updater; Type: TRIGGER; Schema: public; Owner: wwwadm
911--
912
913CREATE TRIGGER date_updater
914    AFTER INSERT OR UPDATE ON grille
915    FOR EACH ROW
916    EXECUTE PROCEDURE date_updater();
917
918
919--
920-- Name: color_index_cm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
921--
922
923ALTER TABLE ONLY color_index
924    ADD CONSTRAINT color_index_cm_id_fkey FOREIGN KEY (cm_id) REFERENCES colormap(cm_id);
925
926
927--
928-- Name: color_index_col_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
929--
930
931ALTER TABLE ONLY color_index
932    ADD CONSTRAINT color_index_col_id_fkey FOREIGN KEY (col_id) REFERENCES color(col_id);
933
934
935--
936-- Name: fk_code_contientl_codifica; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
937--
938
939ALTER TABLE ONLY code
940    ADD CONSTRAINT fk_code_contientl_codifica FOREIGN KEY (id_codification) REFERENCES codification(id_codification) ON UPDATE RESTRICT ON DELETE RESTRICT;
941
942
943--
944-- Name: fk_codifica_detype_typecodi; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
945--
946
947ALTER TABLE ONLY codification
948    ADD CONSTRAINT fk_codifica_detype_typecodi FOREIGN KEY (id_typecodification) REFERENCES typecodification(id_typecodification) ON UPDATE RESTRICT ON DELETE RESTRICT;
949
950
951--
952-- Name: fk_concerne_concerne2_referenc; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
953--
954
955ALTER TABLE ONLY concerne
956    ADD CONSTRAINT fk_concerne_concerne2_referenc FOREIGN KEY (id_references) REFERENCES "REFERENCES"(id_references) ON UPDATE RESTRICT ON DELETE RESTRICT;
957
958
959--
960-- Name: fk_concerne_concerne_produit; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
961--
962
963ALTER TABLE ONLY concerne
964    ADD CONSTRAINT fk_concerne_concerne_produit FOREIGN KEY (id_produit) REFERENCES produit(id_produit) ON UPDATE RESTRICT ON DELETE RESTRICT;
965
966
967--
968-- Name: fk_fichier_contient_produit; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
969--
970
971ALTER TABLE ONLY fichier
972    ADD CONSTRAINT fk_fichier_contient_produit FOREIGN KEY (id_produit) REFERENCES produit(id_produit) ON UPDATE RESTRICT ON DELETE RESTRICT;
973
974
975--
976-- Name: fk_grille_appartien_sequence; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
977--
978
979ALTER TABLE ONLY grille
980    ADD CONSTRAINT fk_grille_appartien_sequence FOREIGN KEY (id_sequence) REFERENCES "sequence"(id_sequence) ON UPDATE RESTRICT ON DELETE RESTRICT;
981
982
983--
984-- Name: fk_grille_contientl_produit; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
985--
986
987ALTER TABLE ONLY grille
988    ADD CONSTRAINT fk_grille_contientl_produit FOREIGN KEY (id_produit) REFERENCES produit(id_produit) ON UPDATE RESTRICT ON DELETE RESTRICT;
989
990
991--
992-- Name: fk_grille_deparamet_parametr; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
993--
994
995ALTER TABLE ONLY grille
996    ADD CONSTRAINT fk_grille_deparamet_parametr FOREIGN KEY (id_param) REFERENCES parametre(id_param) ON UPDATE RESTRICT ON DELETE RESTRICT;
997
998
999--
1000-- Name: fk_grille_est_code_codifica; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
1001--
1002
1003ALTER TABLE ONLY grille
1004    ADD CONSTRAINT fk_grille_est_code_codifica FOREIGN KEY (id_codification) REFERENCES codification(id_codification) ON UPDATE RESTRICT ON DELETE RESTRICT;
1005
1006
1007--
1008-- Name: fk_parametr_decategor_categori; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
1009--
1010
1011ALTER TABLE ONLY parametre
1012    ADD CONSTRAINT fk_parametr_decategor_categori FOREIGN KEY (id_categorieparametre) REFERENCES categorieparametre(id_categorieparametre) ON UPDATE RESTRICT ON DELETE RESTRICT;
1013
1014
1015--
1016-- Name: fk_parametr_dunite_unite; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
1017--
1018
1019ALTER TABLE ONLY parametre
1020    ADD CONSTRAINT fk_parametr_dunite_unite FOREIGN KEY (id_unite) REFERENCES unite(id_unite) ON UPDATE RESTRICT ON DELETE RESTRICT;
1021
1022
1023--
1024-- Name: fk_personne_appartien_organism; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
1025--
1026
1027ALTER TABLE ONLY personne
1028    ADD CONSTRAINT fk_personne_appartien_organism FOREIGN KEY (id_organisme) REFERENCES organisme(id_organisme) ON UPDATE RESTRICT ON DELETE RESTRICT;
1029
1030
1031--
1032-- Name: fk_produit_contactda_personne; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
1033--
1034
1035ALTER TABLE ONLY produit
1036    ADD CONSTRAINT fk_produit_contactda_personne FOREIGN KEY (id_contactthem) REFERENCES personne(id_personne) ON UPDATE RESTRICT ON DELETE RESTRICT;
1037
1038
1039--
1040-- Name: fk_produit_contactte_personne; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
1041--
1042
1043ALTER TABLE ONLY produit
1044    ADD CONSTRAINT fk_produit_contactte_personne FOREIGN KEY (id_contactbase) REFERENCES personne(id_personne) ON UPDATE RESTRICT ON DELETE RESTRICT;
1045
1046
1047--
1048-- Name: fk_produit_contactth_personne; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
1049--
1050
1051ALTER TABLE ONLY produit
1052    ADD CONSTRAINT fk_produit_contactth_personne FOREIGN KEY (id_contacttech) REFERENCES personne(id_personne) ON UPDATE RESTRICT ON DELETE RESTRICT;
1053
1054
1055--
1056-- Name: fk_produit_fournitpa_organism; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
1057--
1058
1059ALTER TABLE ONLY produit
1060    ADD CONSTRAINT fk_produit_fournitpa_organism FOREIGN KEY (id_organisme) REFERENCES organisme(id_organisme) ON UPDATE RESTRICT ON DELETE RESTRICT;
1061
1062
1063--
1064-- Name: fk_produit_origine2_produito; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
1065--
1066
1067ALTER TABLE ONLY produit
1068    ADD CONSTRAINT fk_produit_origine2_produito FOREIGN KEY (id_produitorig) REFERENCES produitorig(id_produitorig) ON UPDATE RESTRICT ON DELETE RESTRICT;
1069
1070
1071--
1072-- Name: fk_produit_surledoma_domaine; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
1073--
1074
1075ALTER TABLE ONLY produit
1076    ADD CONSTRAINT fk_produit_surledoma_domaine FOREIGN KEY (id_domaine) REFERENCES domaine(id_domaine) ON UPDATE RESTRICT ON DELETE RESTRICT;
1077
1078
1079--
1080-- Name: param_color_cm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
1081--
1082
1083ALTER TABLE ONLY param_color
1084    ADD CONSTRAINT param_color_cm_id_fkey FOREIGN KEY (cm_id) REFERENCES colormap(cm_id);
1085
1086
1087--
1088-- Name: param_color_id_param_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wwwadm
1089--
1090
1091ALTER TABLE ONLY param_color
1092    ADD CONSTRAINT param_color_id_param_fkey FOREIGN KEY (id_param) REFERENCES parametre(id_param);
1093
1094
1095--
1096-- Name: public; Type: ACL; Schema: -; Owner: postgres
1097--
1098
1099REVOKE ALL ON SCHEMA public FROM PUBLIC;
1100REVOKE ALL ON SCHEMA public FROM postgres;
1101GRANT ALL ON SCHEMA public TO postgres;
1102GRANT ALL ON SCHEMA public TO PUBLIC;
1103
1104
1105--
1106-- PostgreSQL database dump complete
1107--
1108
Note: See TracBrowser for help on using the repository browser.