[Qgis-user] Help to load a postgis view on QGIS : primary key required

Lore M tchibadou at hotmail.com
Fri Sep 25 02:31:58 PDT 2009


Hi 

I have kind of an ordinary (but still thorny) problem with Qgis (version 1.0.2kore) when I try to load a postgis layer. I'm sorry because there is several posts about this problem but neither of the solutions proposed solve my own problem...

So, I've got two tables in my postgreSQL database and I create a view from them.

-- View: calendrier_area
CREATE OR REPLACE VIEW calendrier_area AS 
 SELECT calendrier_activite.gid, calendrier_activite.annee, calendrier_activite.mois, calendrier_activite.navire_code, calendrier_activite.zone, ciem_areas.ices_area, ciem_areas.the_geom
   FROM calendrier_activite, ciem_areas
  WHERE "substring"(calendrier_activite.zone::text, 1, 4) = "substring"(ciem_areas.ices_area::text, 1, 4);
ALTER TABLE calendrier_area OWNER TO postgres;

The attribute "gid" from the table "calendrier_activite" is UNIQUE (I check this with "SELECT DISTINCT * FROM calendrier_area;" and there is as many lines as in table "SELECT * FROM calendrier_area"). Moreover, "gid" type is "serial" so "int4". Therefore, calendrier_area.gid can be considered as a PRIMARY KEY in the view.

For all that, I can't load this view in Qgis : it still ask me for PRIMARY KEY in the view calendrier_area.

Do you any idea please ??? Thanks everyone

Lore
 
 		 	   		  
_________________________________________________________________
Découvrez toutes les possibilités de communication avec vos proches
http://www.microsoft.com/windows/windowslive/default.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20090925/6875d101/attachment.html>


More information about the Qgis-user mailing list