<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi Nyall,</p>
<p>Thank you for this fix.</p>
<p>I'm on windows so I guess I have to wait for this fix to be merged then download master. Am I right?</p>
<p>Will it be in qgis-dev or qgis-rel-dev or both?</p>
<p>Le 2016-11-09 07:57, Nyall Dawson a écrit :</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">On 9 November 2016 at 16:26, Neumann, Andreas <<a href="mailto:a.neumann@carto.net">a.neumann@carto.net</a>> wrote:
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">Hi Nicolas,<br /> <br /> We have similar issues in our projects.<br /> <br /> It looks like a bug to me that the default value is called that many times.<br /> <br /> Matthias: any comments on that? Or can you explain why this happens and how<br /> this can be potentially fixed?</blockquote>
<br /> <br /> It's (probably) fixed with <a href="https://github.com/qgis/QGIS/pull/3733">https://github.com/qgis/QGIS/pull/3733</a>, but<br /> testing & confirmation would be good!<br /> <br /> Nyall<br /> <br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><br /> Greetings,<br /> <br /> Andreas<br /> <br /> On 2016-11-08 17:50, Nicolas Boisteault wrote:<br /> <br /> Logs confirm the issue :<br /> <br /> First time form opened :<br /> <br /> 2016-11-08 17:45:03 CET [15733-1] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:45:03 CET [15733-2] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:45:03 CET [15733-3] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:45:03 CET [15733-4] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:45:03 CET [15733-5] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:45:03 CET [15733-6] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:45:03 CET [15733-7] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:45:03 CET [15733-8] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:45:03 CET [15733-9] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:45:03 CET [15733-10] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:45:03 CET [15733-11] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> <br /> Second time form opened :<br /> <br /> <br /> 2016-11-08 17:47:10 CET [15733-48] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:47:10 CET [15733-49] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:47:10 CET [15733-50] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:47:10 CET [15733-51] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:47:10 CET [15733-52] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:47:10 CET [15733-53] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:47:10 CET [15733-54] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:47:10 CET [15733-55] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:47:10 CET [15733-56] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:47:10 CET [15733-57] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> 2016-11-08 17:47:10 CET [15733-58] <a href="mailto:user@carto">user@carto</a> LOG: statement: SELECT<br /> nextval('public.station_gid_seq'::regclass)<br /> <br /> If someone can confirm this issue I'll open a ticket.<br /> <br /> <br /> <br /> Le 2016-11-08 17:27, Nicolas Boisteault a écrit :<br /> <br /> What is weird is that every time I open the form it increments sequence of<br /> 11 not 1. So I guess nextval is called 11 times! I'll try to log that. I'm<br /> using QGIS 2.18.<br /> <br /> Le 2016-11-08 16:35, Matthias Kuhn a écrit :<br /> <br /> Yes, every time you open a form, a new gid is retrieved (nextval is<br /> executed) what makes the counter go up very fast.<br /> <br /> Another thing that could need some attention (it might have changed with<br /> <a href="https://github.com/qgis/QGIS/pull/3733">https://github.com/qgis/QGIS/pull/3733</a> but I didn't check in detail).<br /> <br /> Matthias<br /> <br /> On 11/08/2016 04:19 PM, Nicolas Boisteault wrote:<br /> <br /> Matthias,<br /> <br /> Thank you for the tip.<br /> <br /> It works without transactional editing.<br /> <br /> I enabled it to test and I like the fact that observation layer is<br /> automatically put in editable state when I put station layer as<br /> editable. It is very convenient for users. I'll modify the foreign<br /> key constraint and will tell if it works for me.<br /> <br /> Now I have an issue which is not related to transactional editing. When<br /> I create a new station the gid parameter is incremented by +11 not +1.<br /> <br /> Can anyone confirm this issue? Thanks.<br /> <br /> Le 2016-11-08 14:44, Matthias Kuhn a écrit :<br /> <br /> Nicolas,<br /> <br /> Sorry I forgot: you will probably also need to enable transactional<br /> editing and set the foreign key constraint check to deferred to make it<br /> work properly.<br /> <br /> Regards<br /> Matthias<br /> <br /> On 11/08/2016 02:08 PM, Nicolas Boisteault wrote:<br /> <br /> This is perfect! Thank you very much Matthias.<br /> <br /> Le 2016-11-08 12:45, Matthias Kuhn a écrit :<br /> <br /> Go to the project properties and on the data sources tab check "evaluate<br /> default values on provider side".<br /> <br /> Regards<br /> Matthias<br /> <br /> On 11/08/2016 12:37 PM, Nicolas Boisteault wrote:<br /> <br /> Hi Matthias Kuhn,<br /> <br /> First thank you very much for your help and your work on this feature<br /> There is room for improvement but this functionality is already great<br /> as it.<br /> <br /> Another question. I also tried to add a station and an observation from<br /> the station form.<br /> <br /> When creating, I have 'nextval('public.station_gid_seq'::regclass)' in<br /> the gid attribute and in the id_station attribute too which is good<br /> to me.<br /> <br /> Now if i save the observation feature first it won't work because the<br /> station feature it refers doesn't exist. It is logical to me.<br /> <br /> But if save the new station feature, it only save this feature and not<br /> the relative observation with the newly foreign created.<br /> <br /> Is it a bug or a limitation? Thanks.<br /> <br /> Le 2016-11-08 12:09, Matthias Kuhn a écrit :<br /> <br /> Hi Nicolas,<br /> <br /> This is a limitation of the current implementation.<br /> <br /> You can either add a new station without geometry first and then<br /> select<br /> it in the attribute table and use the add part tool to add a geometry.<br /> <br /> Or add it from its own layer and then link it to the parent<br /> observation.<br /> <br /> I agree there is room for improvement.<br /> <br /> Regards<br /> Matthias<br /> <br /> On 11/08/2016 11:49 AM, Nicolas Boisteault wrote:<br /> <br /> <br /> <br /> Hi List,<br /> <br /> I have two tables :<br /> <br />   * station : gid, geom (point)<br />   * observation : id, id_station (foreign key)<br /> <br /> There is a 1:N relation; for one station feature there are multiple<br /> observation features.<br /> <br /> I add the relation between my two tables in QGIS -> project<br /> properties.<br /> I use the relation reference widget on id_station and check 'able the<br /> add of new entities' (not sure about my english translation)<br /> <br /> So now when I create a new observation I can click the plus symbol to<br /> add a station but I can't see how I can create the point<br /> geometry. I'm<br /> not able to click the map.<br /> <br /> Any hint? Thank you all.<br /> <br /> --<br /> <br /> Nicolas BOISTEAULT<br /> <br /> <br /> <br /> <br /> <br /> _______________________________________________<br /> Qgis-user mailing list<br /> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>><br /> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>>><br /> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br /> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>><br /> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br /> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>>>><br /> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /> <br /> _______________________________________________<br /> Qgis-user mailing list<br /> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>><br /> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>>><br /> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br /> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>><br /> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a> <mailto:<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>>>><br /> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /> <br /> <br /> _______________________________________________<br /> Qgis-user mailing list<br /> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br /> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /> <br /> <br /> _______________________________________________<br /> Qgis-user mailing list<br /> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br /> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /> <br /> <br /> <br /> <br /> <br /> _______________________________________________<br /> Qgis-user mailing list<br /> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br /> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></blockquote>
</div>
</blockquote>
</body></html>