<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Thanks it works now !<br>I just have to define gid as a primary key in the table used to create the view...even if I would prefer to have several attributes as one primary key.<br>(Just to know, I also tried, as <span id="PresenceContainer"><b>Remco Houtkamp </b>said,</span> with <font style="" color="#0c0c0c"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);" lang="EN-US">Quantum Gis 1.3 (Mimas) </span></font><font style="" color="#0c0c0c"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);" lang="EN-US">via osg4w</span></font> but it doesn't work.)<br>Thanks again !<br><br>> Date: Fri, 25 Sep 2009 11:40:24 +0200<br>> From: Bernhard.Stroebl@jena.de<br>> To: qgis-user@lists.osgeo.org<br>> Subject: Re: [Qgis-user] Help to load a postgis view on QGIS : primary key    required<br>> <br>> Hi Lore,<br>> <br>> AFAIK you _must_ define the gid field as a primary key in your base <br>> table, it does not matter if it can be considered to be one.<br>> <br>> ALTER TABLE calendrier_activite ADD PRIMARY KEY (gid);<br>> <br>> Bernhard<br>> <br>> Lore M schrieb:<br>> > Hi <br>> > <br>> > 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...<br>> > <br>> > So, I've got two tables in my postgreSQL database and I create a view from them.<br>> > <br>> > -- View: calendrier_area<br>> > CREATE OR REPLACE VIEW calendrier_area AS <br>> >  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<br>> >    FROM calendrier_activite, ciem_areas<br>> >   WHERE "substring"(calendrier_activite.zone::text, 1, 4) = "substring"(ciem_areas.ices_area::text, 1, 4);<br>> > ALTER TABLE calendrier_area OWNER TO postgres;<br>> > <br>> > 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.<br>> > <br>> > For all that, I can't load this view in Qgis : it still ask me for PRIMARY KEY in the view calendrier_area.<br>> > <br>> > Do you any idea please ??? Thanks everyone<br>> > <br>> > Lore<br>> >  <br>> >                                           <br>> > _________________________________________________________________<br>> > Découvrez toutes les possibilités de communication avec vos proches<br>> > http://www.microsoft.com/windows/windowslive/default.aspx<br>> > <br>> > ________ Information from NOD32 ________<br>> > This message was checked by NOD32 Antivirus System for Linux Mail Server.<br>> > http://www.nod32.com<br>> > <br>> > <br>> > <br>> > ------------------------------------------------------------------------<br>> > <br>> > _______________________________________________<br>> > Qgis-user mailing list<br>> > Qgis-user@lists.osgeo.org<br>> > http://lists.osgeo.org/mailman/listinfo/qgis-user<br>> > <br>> > <br>> > ________ Information from NOD32 ________<br>> > This message was checked by NOD32 Antivirus System for Linux Mail Server.<br>> > http://www.nod32.com<br>> <br>> -- <br>> Dipl.-Geogr. Bernhard Ströbl<br>> Anwendungsbetreuer GIS<br>> Kommunale Immobilien Jena<br>>   - Datenverarbeitung -<br>> mailto:Bernhard.Stroebl@jena.de<br>> http://kij.jena.de/<br>> ----------------------------<br>> <br>> <br>> ________ Information from NOD32 ________<br>> This message was checked by NOD32 Antivirus System for Linux Mail Server.<br>> http://www.nod32.com<br>> _______________________________________________<br>> Qgis-user mailing list<br>> Qgis-user@lists.osgeo.org<br>> http://lists.osgeo.org/mailman/listinfo/qgis-user<br>                                       <br /><hr />Souhaitez vous  « être au bureau sans y être » ? <a href='http://www.microsoft.com/france/windows/bts/default.mspx' target='_new'>Oui je le veux !</a></body>
</html>