<div dir="ltr">Hi Bo,<div><br></div><div>Yes, serial -type has been working always. But since PostgreSQL 10 identity has been preferred (?) way to handle primary keys, I have followed that guideline: <a href="https://www.depesz.com/2017/04/10/waiting-for-postgresql-10-identity-columns/">https://www.depesz.com/2017/04/10/waiting-for-postgresql-10-identity-columns/</a></div><div><br></div><div>But, I see that this has already been fixed. Thank you, I will test later on.</div><div><br></div><div>Rgs,</div><div><br></div><div>Pekka<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><p><span style="font-size:12.8000001907349px">Pekka Sarkola<br></span><span style="font-size:12.8000001907349px">Gispo Oy<br></span><a href="mailto:pekka.sarkola@gispo.fi" style="font-size:12.8000001907349px" target="_blank">pekka.sarkola@gispo.fi</a><span style="font-size:12.8000001907349px">   -
GSM +358 40 725 2042<br></span><a href="http://www.gispo.fi/" style="font-size:12.8000001907349px" target="_blank">www.gispo.fi</a><span style="font-size:12.8000001907349px"> – </span><a href="http://www.paikkatieto.com/" style="font-size:12.8000001907349px" target="_blank">www.paikkatieto.com</a></p></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">to 3. kesäk. 2021 klo 11.07 Bo Victor Thomsen (<a href="mailto:bo.victor.thomsen@gmail.com">bo.victor.thomsen@gmail.com</a>) kirjoitti:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <p>Hi Pekka -</p>
    <p>I think you ran into a QGIS - Postgres problem using the
      "identity" type qualifier.<br>
    </p>
    <p>I tried to execute your "create table" example with the
      "Identity" type definition for the primary key. It doesn't create
      the sequence that QGIS assumes exist.</p>
    <p>Changing you sample code to:</p>
    <p><font face="monospace">    CREATE TABLE IF NOT EXISTS
        data.sample_point2<br>
            (<br>
                fid serial NOT NULL,<br>
                wkb_point geometry(Point,3067),<br>
                name varchar,<br>
                CONSTRAINT sample_point2_pk PRIMARY KEY (fid)<br>
            );<br>
      </font><br>
      i.e change the PK column to a "serial" will produce the expected
      sequence in Postgres. The last table will probably function
      correctly in QGIS  (Not tested, and yes - I know: Identity and
      Serial types is not the same)<br>
    </p>
    <p> <br>
    </p>
    <pre cols="72">Med venlig hilsen / Kind regards

Bo Victor Thomsen</pre>
    <div>Den 03-06-2021 kl. 08:23 skrev Pekka
      Sarkola:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">Hi,
        <div> </div>
        <div>You repeat this "<span style="white-space:pre-wrap">ERROR: column "sample_point_fid_seq" does not exist" -problem with:</span></div>
        <div><span style="white-space:pre-wrap">
</span></div>
        <div><span style="white-space:pre-wrap">Create very simple table to PostGIS (choose your own CRS):</span></div>
        <blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
          <div>CREATE TABLE IF NOT EXISTS sample_point</div>
          <div>(</div>
          <div>    fid integer NOT NULL GENERATED ALWAYS AS IDENTITY,</div>
          <div>    wkb_point geometry(Point,3067),</div>
          <div>    name varchar,</div>
          <div>    CONSTRAINT sample_point_pk PRIMARY KEY (fid)</div>
          <div>);</div>
        </blockquote>
        <div>
          <p style="margin:0px;white-space:pre-wrap">
</p>
          <p style="margin:0px;white-space:pre-wrap">Add table to QGIS. Editing works, without errors.</p>
          <p style="margin:0px;white-space:pre-wrap">
</p>
          <p style="margin:0px;white-space:pre-wrap">If you tick on from project properties: "<span style="font-family:Verdana,Geneva,sans-serif;font-size:13.3333px">Evaluate default values on provider side", error will happen:</span></p>
          <p style="margin:0px;white-space:pre-wrap">
</p>
        </div>
        <blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
          <div>
            <p style="margin:0px;white-space:pre-wrap"><span style="color:rgb(220,125,0)">2021-06-03T09:22:31     WARNING    </span>Erroneous query: SELECT nextval("sample_point_fid_seq"::regclass) returned 7 [ERROR: column "sample_point_fid_seq" does not exist</p>
          </div>
          <div>
            <p style="margin:0px;white-space:pre-wrap">             LINE 1: SELECT nextval("sample_point_fid_seq"::regclass)</p>
          </div>
          <div>
            <p style="margin:0px;white-space:pre-wrap">              ^</p>
          </div>
          <div>
            <p style="margin:0px;white-space:pre-wrap">             ]</p>
          </div>
          <div>
            <p style="margin:0px;white-space:pre-wrap">
</p>
          </div>
        </blockquote>
        <div>Rgs,</div>
        <div><br>
        </div>
        <div>Pekka</div>
        <div>
          <div>
            <div>
              <div dir="ltr">
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <p><span style="font-size:12.8px">Pekka
                              Sarkola<br>
                            </span><span style="font-size:12.8px">Gispo
                              Oy<br>
                            </span><a href="mailto:pekka.sarkola@gispo.fi" style="font-size:12.8px" target="_blank">pekka.sarkola@gispo.fi</a><span style="font-size:12.8px">   -
                              GSM +358 40 725 2042<br>
                            </span><a href="http://www.gispo.fi/" style="font-size:12.8px" target="_blank">www.gispo.fi</a><span style="font-size:12.8px"> – </span><a href="http://www.paikkatieto.com/" style="font-size:12.8px" target="_blank">www.paikkatieto.com</a></p>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <br>
          </div>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">to 3. kesäk. 2021 klo 8.47
          Pekka Sarkola (<a href="mailto:pekka@gispo.fi" target="_blank">pekka@gispo.fi</a>) kirjoitti:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="ltr">Hi Alexandre et al,
            <div><br>
            </div>
            <div>I re-create a database (sample one), create a new QGIS
              project, add layers => same error. Maybe I open an
              issue in Github and I can share more SQL and snapshots.</div>
            <div><br>
            </div>
            <div>Rgs,</div>
            <div><br>
            </div>
            <div>Pekka<br clear="all">
              <div>
                <div dir="ltr">
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr">
                            <p><span style="font-size:12.8px">Pekka
                                Sarkola<br>
                              </span><span style="font-size:12.8px">Gispo
                                Oy<br>
                              </span><a href="mailto:pekka.sarkola@gispo.fi" style="font-size:12.8px" target="_blank">pekka.sarkola@gispo.fi</a><span style="font-size:12.8px">   -
                                GSM +358 40 725 2042<br>
                              </span><a href="http://www.gispo.fi/" style="font-size:12.8px" target="_blank">www.gispo.fi</a><span style="font-size:12.8px"> – </span><a href="http://www.paikkatieto.com/" style="font-size:12.8px" target="_blank">www.paikkatieto.com</a></p>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <br>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">ti 1. kesäk. 2021 klo
              16.36 Alexandre Neto (<a href="mailto:senhor.neto@gmail.com" target="_blank">senhor.neto@gmail.com</a>)
              kirjoitti:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div dir="auto">
                <div>From that last error...</div>
                <div dir="auto"><br>
                </div>
                <div dir="auto">Are you sure your table was not changed
                  after being loaded to QGIS? It seems to expect a
                  sequence that no longer exists.</div>
                <div dir="auto"><br>
                </div>
                <div dir="auto">Alexandre Neto<br>
                  <br>
                  <div class="gmail_quote" dir="auto">
                    <div dir="ltr" class="gmail_attr">A terça,
                      1/06/2021, 12:22, Pekka Sarkola <<a href="mailto:pekka@gispo.fi" rel="noreferrer" target="_blank">pekka@gispo.fi</a>>
                      escreveu:<br>
                    </div>
                    <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                      <div dir="ltr">Hi Andreas,
                        <div><br>
                        </div>
                        <div>Trasnsactions groups are enabled: editing
                          is working (not in embedded forms) as
                          expected.</div>
                        <div><br>
                        </div>
                        <div>If I enable "Evaluate default
                          values.."-option, I will get error:</div>
                        <div><br>
                        </div>
                        <div>2021-06-01T14:11:44     WARNING  
                           Erroneous query: SELECT
                          nextval("sample_point_fid_seq"::regclass)
                          returned 7 [ERROR: column
                          "sample_point_fid_seq" does not exist<br>
                                       LINE 1: SELECT
                          nextval("sample_point_fid_seq"::regclass)<br>
                        </div>
                        <div><br>
                        </div>
                        <div>Primary key of the geometry table is "fid"
                          and it has been defined as IDENTITY column
                          (fid integer NOT NULL GENERATED ALWAYS AS
                          IDENTITY ( INCREMENT 1 START 1 MINVALUE 1
                          MAXVALUE 2147483647 CACHE 1 ). </div>
                        <div><br>
                        </div>
                        <div>I presume this evaluation of the default
                          values is not the solution for this case.</div>
                        <div><br>
                        </div>
                        <div>Rgs,</div>
                        <div><br>
                        </div>
                        <div>Pekka</div>
                        <div>
                          <div>
                            <div dir="ltr">
                              <div dir="ltr">
                                <div>
                                  <div dir="ltr">
                                    <div dir="ltr">
                                      <div dir="ltr">
                                        <p><span style="font-size:12.8px">Pekka
                                            Sarkola<br>
                                          </span><span style="font-size:12.8px">Gispo
                                            Oy<br>
                                          </span><a href="mailto:pekka.sarkola@gispo.fi" style="font-size:12.8px" rel="noreferrer noreferrer" target="_blank">pekka.sarkola@gispo.fi</a><span style="font-size:12.8px">  
                                            -
                                            GSM +358 40 725 2042<br>
                                          </span><a href="http://www.gispo.fi/" style="font-size:12.8px" rel="noreferrer noreferrer" target="_blank">www.gispo.fi</a><span style="font-size:12.8px"> –
                                          </span><a href="http://www.paikkatieto.com/" style="font-size:12.8px" rel="noreferrer noreferrer" target="_blank">www.paikkatieto.com</a></p>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                          <br>
                        </div>
                      </div>
                      <br>
                      <div class="gmail_quote">
                        <div dir="ltr" class="gmail_attr">ti 1. kesäk.
                          2021 klo 11.10 Andreas Neumann (<a href="mailto:a.neumann@carto.net" rel="noreferrer noreferrer" target="_blank">a.neumann@carto.net</a>)
                          kirjoitti:<br>
                        </div>
                        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                          <div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
                            <p>Hi Pekka,</p>
                            <p>Have you enabled the  transaction mode in
                              your project?</p>
                            <p>See menu "Project" --> "Properties"
                              --> "Data Sources".</p>
                            <p>I usually enable all three check boxes:</p>
                            <p>- Automatically create transaction groups
                              where possible</p>
                            <p>- Evaluate default values on provider
                              side</p>
                            <p>- Trust project when data source has no
                              metadata</p>
                            <p>The transaction mode allows to edit all
                              layers from the same data base connection
                              (needs identical db connection string and
                              credentials) and - together with "evaluate
                              default values on provider side" -
                              immediately retrieves primary keys from
                              the DB, so that you can link objects
                              immediately, without having to save first.</p>
                            <p>Greetings,</p>
                            <p>Andreas</p>
                            <p id="gmail-m_-5043185801172881578gmail-m_4909453872134249719gmail-m_6966861146379103330m_-1225167921545535123m_6615023869504359420gmail-m_-7168818297288270819reply-intro">On
                              2021-06-01 09:55, Pekka Sarkola wrote:</p>
                            <blockquote type="cite" style="padding:0px 0.4em;border-left:2px solid rgb(16,16,255);margin:0px">
                              <div id="gmail-m_-5043185801172881578gmail-m_4909453872134249719gmail-m_6966861146379103330m_-1225167921545535123m_6615023869504359420gmail-m_-7168818297288270819replybody1">
                                <div>
                                  <div dir="ltr">Hi folks!
                                    <div> </div>
                                    <div>I have a problem editing
                                      feature attributes in embedded
                                      forms. Data is stored in PostGIS
                                      and I have a simple 1:1
                                      relationship with the geometry
                                      table and an additional
                                      attribute table. QGIS version is
                                      3.18.3 on Ubuntu. </div>
                                    <div> </div>
                                    <div>I have created a custom form
                                      with a drag-and-drop designer. I
                                      can edit additional
                                      attribute table attributes in
                                      embedded form, but those edits are
                                      not stored anywhere. I have to
                                      open a separate form and then edit
                                      attribute values of the related
                                      attribute table. This is quite
                                      annoying for the end user.</div>
                                    <div> </div>
                                    <div>Any suggestions? Or should I
                                      write a better description to the
                                      Github?</div>
                                    <div> </div>
                                    <div>Rgs,</div>
                                    <div> </div>
                                    <div>Pekka</div>
                                    <div>
                                      <div>
                                        <div dir="ltr">
                                          <div dir="ltr">
                                            <div>
                                              <div dir="ltr">
                                                <div dir="ltr">
                                                  <div dir="ltr">
                                                    <p><span style="font-size:12.8px">Pekka
                                                        Sarkola<br>
                                                      </span><span style="font-size:12.8px">Gispo
                                                        Oy<br>
                                                      </span><a style="font-size:12.8px" href="mailto:pekka.sarkola@gispo.fi" rel="noreferrer noreferrer
                                                        noreferrer" target="_blank">pekka.sarkola@gispo.fi</a><span style="font-size:12.8px">  
                                                        - GSM +358
                                                        40 725 2042<br>
                                                      </span><a style="font-size:12.8px" href="http://www.gispo.fi/" rel="noopener noreferrer noreferrer
                                                        noreferrer" target="_blank">www.gispo.fi</a><span style="font-size:12.8px"> –
                                                      </span><a style="font-size:12.8px" href="http://www.paikkatieto.com/" rel="noopener noreferrer noreferrer
                                                        noreferrer" target="_blank">www.paikkatieto.com</a></p>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                              <br>
                              <div style="margin:0px;padding:0px;font-family:monospace">_______________________________________________<br>
                                Qgis-user mailing list<br>
                                <a href="mailto:Qgis-user@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">Qgis-user@lists.osgeo.org</a><br>
                                List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noopener noreferrer noreferrer
                                  noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
                                Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noopener noreferrer noreferrer
                                  noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></div>
                            </blockquote>
                            <p><br>
                            </p>
                          </div>
                        </blockquote>
                      </div>
                      _______________________________________________<br>
                      Qgis-user mailing list<br>
                      <a href="mailto:Qgis-user@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">Qgis-user@lists.osgeo.org</a><br>
                      List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
                      Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
                    </blockquote>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
        </blockquote>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
Qgis-user mailing list
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
    </blockquote>
  </div>

_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div>