<div dir="ltr">Hi !<div><br></div><div>When inserting features on a postgis table, it seems columns whose widget is hidden are set to null, rather than not inserted at all.</div><div><br></div><div>If I hide (or set to readonly) the "id" column (a good idea anyways), it make the following query on creating features:</div>

<div>INSERT INTO mytable("id","name","geometry") VALUES (null,'abc',geom)<br></div><div>But the user intends to do this query:</div><div>INSERT INTO mytable("name","geometry") VALUES ('abc',geom)<br>

</div><div><br></div><div>It seem QGIS is clever enough to fix the obvious problem for the primary key of the tables (since one doesn't get not-null constrain violation upon inserts), but is not clever enough to make it work on views (for whose you get that non-null violation).</div>

<div><br></div><div>Postgres' views are editable by default when on single tables without needing any rule/trigger, which is a very neat feature. But it's unusable in QGIS for now because of this.</div><div><br></div>

<div>I think we should make it work as state above, maybe even removing the fix for the primary id, but rather set the form to "readonly" by default for autoincrementing primary fields.</div><div><br></div><div>

What do you think ? Should I file a bug ? Am I missing something ?</div><div><br></div><div>Thanks and happy easters !</div><div><br></div><div>Olivier Dalang</div><div><div><div><div><br></div><div><br></div>


<p style="margin:0px"></p></div></div></div></div>