Re: [Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Raymond Nijssen
Thanks all for pointing things out! My view did have a unique id, it is just a sub set of another table. So by selecting it everything is solved. On 26-03-15 11:45, Matthias Kuhn wrote: Hi Raymond, The feature shown in the identify result is the one queried with the geographic location. Fo

Re: [Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Matthias Kuhn
Hi Raymond, The feature shown in the identify result is the one queried with the geographic location. For some reason the feature shown in the feature form is not a copy of the identified data (feature) but queried again with its feature id. For the views on pg databases I have here, the primary

Re: [Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Mark Wynter
gt; To: qgis-developer@lists.osgeo.org > Subject: Re: [Qgis-developer] wrong attribute values for postgis data > in Feature attribute form > Message-ID: <5513dc52.8040...@terglobo.nl> > Content-Type: text/plain; charset=utf-8; format=flowed > > Thanks Bernhard. I just figur

Re: [Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Junior Delaz
Hi, Raymond, you can use the row_number function to add a primary key to your view. Something like : CREATE OR REPLACE view myview as SELECT row_number () over ()::integer as id, fieldA, Field ... from mytable . will add an unique integer field _id_ to your view. And this one can be used in QGI

Re: [Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Bernhard Ströbl
Hi Raymond, I thought it might be views because I never had any problems with tables. When defining views you should include a field 1) that is a primary key in the table it comes from and 2) whose values are unique in the view. example: view with _one_ owner per parcel (parcels may be include

Re: [Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Raymond Nijssen
Thanks Bernhard. I just figured that. But my layer is not a table, it is a view. And it seems that PostgreSQL cannot have constraints on views. So, I think I just need to carefully select the right key field when loading it. (And maybe QGIS could be slightly smarter by not suggesting a boolea

Re: [Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Bernhard Ströbl
Hi Raymond, Am 26.03.2015 10:57, schrieb Raymond Nijssen: Thanks Regis, that was exactly the issue. The (boolean!) field 'inonderzoek' was used as a key. When I change that to 'gid' in the Add PostGIS Table dialog, everything works correctly. Can anyone tell me why QGIS picks that boolean field

Re: [Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Raymond Nijssen
Thanks Regis, that was exactly the issue. The (boolean!) field 'inonderzoek' was used as a key. When I change that to 'gid' in the Add PostGIS Table dialog, everything works correctly. Can anyone tell me why QGIS picks that boolean field for most of my tables? Can I change that behaviour by ch

Re: [Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Régis Haubourg
Hi, I have seen such troubles when the choosen primary key from qgis side is not unique . Symptoms: selecting one feature select severals unrelated features of the same layer. relation with attributes is broken also. Can you check in your layer's definition (general tab of layer properties) if

[Qgis-developer] wrong attribute values for postgis data in Feature attribute form

2015-03-26 Thread Raymond Nijssen
When I use the Feature info tool with the "Auto open form" option selected, the form shows different values compared to the identify results. The Identify results are correct. Here's a screenshot: http://terglobo.nl/downloads/qgis_attribute_form_bug.png I am using QGIS Testing (just updated) o