-- View: mf.vu_parcelle_j_comun_j_site

-- DROP VIEW mf.vu_parcelle_j_comun_j_site;

CREATE OR REPLACE VIEW mf.vu_parcelle_j_comun_j_site AS 
 SELECT parcelle.id_parcelle, parcelle.cleparc, communes.dept, communes.nomcomun, parcelle.lieu_dit, sites.code_site, sites.libl_site, parcelle.numr_parcelle, parcelle.surface, parcelle.code_acte, parcelle.code_acte_vie
   FROM spatial.communes, mf.parcelle, sites
  WHERE parcelle.code_insee::text = communes.numero::text AND parcelle.code_site::bpchar = sites.code_site::bpchar;

ALTER TABLE mf.vu_parcelle_j_comun_j_site OWNER TO ludodo;
GRANT ALL ON TABLE mf.vu_parcelle_j_comun_j_site TO ludodo;
GRANT SELECT, REFERENCES, TRIGGER ON TABLE mf.vu_parcelle_j_comun_j_site TO public;
GRANT SELECT, REFERENCES, TRIGGER ON TABLE mf.vu_parcelle_j_comun_j_site TO cpnrc;

