-- View: vu_vds_event_alljoin

-- DROP VIEW vu_vds_event_alljoin;

CREATE OR REPLACE VIEW vu_vds_event_alljoin AS 
 SELECT vds_evenement.id_event, vds_evenement.date_num, vds_evenement.ref_dept, departements.nom_dept, sites.libl_site, vds_event_categories.groupe, vds_event_categories.categorie, vds_evenement.detail, vds_evenement.etat, "struct_physique_CPNRC".appelation, vds_evenement.createur
   FROM sites, vds_event_categories, vds_evenement, "struct_physique_CPNRC", departements
  WHERE vds_evenement.ref_site = sites.code_site AND vds_evenement.ref_categorie = vds_event_categories.id_categorie AND vds_evenement.ref_structure = "struct_physique_CPNRC".id_struct_physique AND vds_evenement.ref_dept = departements.code_dept::bpchar;

ALTER TABLE vu_vds_event_alljoin OWNER TO postgres;
GRANT ALL ON TABLE vu_vds_event_alljoin TO postgres;
GRANT SELECT, INSERT, REFERENCES, TRIGGER ON TABLE vu_vds_event_alljoin TO public;

