<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 Matthias,</p>
<p>Ok - this is the case here. ili2pg creates bigint pkeys. That explains why I see the "unrelated" internal pkeys from QGIS instead.</p>
<p>It would be really nice if we had an option to create normal "integer" pkeys with ili2pg instead of bigint. Other GIS (like Geomedia) had issues with bigint pkeys as well (at least in older versions).</p>
<p>In 99% of our cases bigint isn't necessary and the ranger of normal integer good enough.</p>
<p>I'll open an issue at ili2pg.</p>
<p>Thanks for you explanation, Matthias!</p>
<p>Andreas</p>
<p id="reply-intro">On 2021-07-12 07:59, Matthias Kuhn wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div>
<div dir="ltr">Hi
<div> </div>
<div>It depends on the implementation in the data provider (and normally on the data type for the primary key).</div>
<div> </div>
<div>In the postgres case, (up to) 32 bit integer primary keys are normally used as fid.</div>
<div>With others like 64 bit integer, string or compound foreign keys it's not possible to stick to this approach, so an internal fid to pk map is generated by the provider at runtime.</div>
<div> </div>
<div>64 bit integers cannot be directly reused as fid because QGIS stores fids internally with 64 bit, but reserves the (negative, -1, -2, ...) half of the available values for new, uncommitted features.</div>
<div> </div>
<div>Matthias</div>
<div> </div>
</div>
<br />
<div class="v1gmail_quote">
<div class="v1gmail_attr" dir="ltr">On Thu, Jul 8, 2021 at 11:50 AM Andreas Neumann <<a href="mailto:andreas@qgis.org" rel="noreferrer">andreas@qgis.org</a>> wrote:</div>
<blockquote class="v1gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;">
<div dir="ltr">
<div>Ok - that explains it.</div>
<div> </div>
<div>It is quite confusing that QGIS uses a different internal ID than the primary key column of the database. Is there a technical reason for this behaviour?</div>
<div> </div>
<div>Andreas</div>
<div> </div>
<div> </div>
</div>
<br />
<div class="v1gmail_quote">
<div class="v1gmail_attr" dir="ltr">On Thu, 8 Jul 2021 at 11:43, Alexandre Neto <<a href="mailto:senhor.neto@gmail.com" rel="noreferrer">senhor.neto@gmail.com</a>> wrote:</div>
<blockquote class="v1gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;">
<div dir="auto">
<div>As far as I remember @atlas_featureid has always returned the same as the $id in the attributes table, which is kind of the internal row number.</div>
<div dir="auto"> </div>
<div dir="auto">Alex<br /><br />
<div class="v1gmail_quote" dir="auto">
<div class="v1gmail_attr" dir="ltr">A quinta, 8/07/2021, 10:35, Andreas Neumann <<a href="mailto:andreas@qgis.org" rel="noreferrer">andreas@qgis.org</a>> escreveu:</div>
<blockquote class="v1gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;">
<div dir="ltr">
<div>HI Jürgen,</div>
<div> </div>
<div>Yes - I provided the primary key column </div>
<div> </div>
<div>Here is my data source string:</div>
<div> </div>
<div>service='edit' authcfg=sogis00 key='t_id' srid=2056 type=Polygon checkPrimaryKeyUnicity='1' table="alw_strukturverbesserungen"."projekt_aggregiert_v" (geometrie_convex_hull) sql=geometrie_bbox IS NOT NULL</div>
<div> </div>
<div>@atlas_featureid returns something like an internal "row number" or similar, but not the column "t_id" as defined in the data source string.</div>
<div> </div>
<div>Andreas</div>
</div>
<br />
<div class="v1gmail_quote">
<div class="v1gmail_attr" dir="ltr">On Thu, 8 Jul 2021 at 10:42, Jürgen E. Fischer <<a href="mailto:jef@norbit.de" rel="noreferrer">jef@norbit.de</a>> wrote:</div>
<blockquote class="v1gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;">Hi Andreas,<br /><br />On Thu, 08. Jul 2021 at 10:30:08 +0200, Andreas Neumann wrote:<br />> attribute(@atlas_feature,'pkey_name'), but it is a little more complicated<br />> than @atlas_featureid - and I'm pretty sure that @atlas_featureid was using<br />> the pkey column in th past?<br />> <br />> My data source for the atlas coverage layer is a Postgis View.<br /><br />It's probably not using the column you expect for the feature id.  Did you<br />specify the key column when adding the view?<br /><br /><br />Jürgen<br /><br />-- <br />Jürgen E. Fischer           norBIT GmbH             Tel. +49-4931-918175-31<br />Dipl.-Inf. (FH)             Rheinstraße 13          Fax. +49-4931-918175-50<br />Software Engineer           D-26506 Norden            <a href="https://www.norbit.de" target="_blank" rel="noopener noreferrer">https://www.norbit.de</a><br />QGIS release manager (PSC)  Germany                 IRC: jef on Libera|OFTC<br />_______________________________________________<br />QGIS-Developer mailing list<br /><a href="mailto:QGIS-Developer@lists.osgeo.org" rel="noreferrer">QGIS-Developer@lists.osgeo.org</a><br />List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br />Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote>
</div>
<br clear="all" /><br />-- <br />
<div dir="ltr">
<div dir="ltr">
<div><br />--<br />Andreas Neumann</div>
<a href="http://QGIS.ORG" target="_blank" rel="noopener noreferrer">QGIS.ORG</a> board member (treasurer)</div>
</div>
_______________________________________________<br />QGIS-Developer mailing list<br /><a href="mailto:QGIS-Developer@lists.osgeo.org" rel="noreferrer">QGIS-Developer@lists.osgeo.org</a><br />List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br />Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all" /><br />-- <br />
<div dir="ltr">
<div dir="ltr">
<div><br />--<br />Andreas Neumann</div>
<a href="http://QGIS.ORG" target="_blank" rel="noopener noreferrer">QGIS.ORG</a> board member (treasurer)</div>
</div>
_______________________________________________<br />QGIS-Developer mailing list<br /><a href="mailto:QGIS-Developer@lists.osgeo.org" rel="noreferrer">QGIS-Developer@lists.osgeo.org</a><br />List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br />Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote>
</div>
</div>
</div>
</blockquote>
<p><br /></p>

</body></html>