<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>There is something odd about how QGIS fetches values from the
      sequence:</p>
    <p>The error message states that :</p>
    <div>
      <p style="margin:0px;white-space:pre-wrap"><i><span style="color:rgb(220,125,0)">2021-06-03T09:22:31     WARNING    </span></i><i>Erroneous query: SELECT nextval("sample_point_fid_seq"::regclass) returned 7 [ERROR: column "sample_point_fid_seq" does not exist</i></p>
    </div>
    <div>
      <p style="margin:0px;white-space:pre-wrap"><i>             LINE 1: SELECT nextval("sample_point_fid_seq"::regclass)</i></p>
    </div>
    <div>
      <p style="margin:0px;white-space:pre-wrap">              ^</p>
      <p style="margin:0px;white-space:pre-wrap">
</p>
      <p style="margin:0px;white-space:pre-wrap">However - a correct call to the "nextval" function should loke like this: 
</p>
      <p style="margin:0px;white-space:pre-wrap">
</p>
      <p style="margin:0px;white-space:pre-wrap"><b><font face="monospace">SELECT nextval('sample_point_fid_seq'::regclass)</font></b></p>
      <p style="margin:0px;white-space:pre-wrap"><font face="monospace">
</font></p>
      <p style="margin:0px;white-space:pre-wrap">*Not* like this ( " contra ') :<font face="monospace">
  </font></p>
      <p style="margin:0px;white-space:pre-wrap"><b><font face="monospace">SELECT nextval("sample_point_fid_seq"::regclass)</font></b></p>
      <p style="margin:0px;white-space:pre-wrap"><font face="monospace">
</font></p>
      <p style="margin:0px;white-space:pre-wrap">So the call fails twice : It calls a non-existing sequence and the function argument  should be 'sample_point_fid_seq'::regclass , not "sample_point_fid_seq"::regclass</p>
    </div>
    <pre class="moz-signature" cols="72">

Med venlig hilsen / Kind regards

Bo Victor Thomsen</pre>
    <div class="moz-cite-prefix">Den 03-06-2021 kl. 08:23 skrev Pekka
      Sarkola:<br>
    </div>
    <blockquote type="cite"
cite="mid:CANgLEnBHgWOzx9WYAyH-XQNOJV7Zi2JFSr4_dn7ZJWSbvZ3SpQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <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:0 0 0 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:0 0 0 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" 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" moz-do-not-send="true">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" moz-do-not-send="true">www.gispo.fi</a><span
                              style="font-size:12.8000001907349px"> – </span><a
                              href="http://www.paikkatieto.com/"
                              style="font-size:12.8000001907349px"
                              target="_blank" moz-do-not-send="true">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"
            moz-do-not-send="true">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"
                                moz-do-not-send="true">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"
                                moz-do-not-send="true">www.gispo.fi</a><span
                                style="font-size:12.8px"> – </span><a
                                href="http://www.paikkatieto.com/"
                                style="font-size:12.8px" target="_blank"
                                moz-do-not-send="true">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"
                moz-do-not-send="true">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" moz-do-not-send="true">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"
                                            moz-do-not-send="true">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"
                                            moz-do-not-send="true">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"
                                            moz-do-not-send="true">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"
                            moz-do-not-send="true">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_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_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"
moz-do-not-send="true">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"
moz-do-not-send="true">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"
moz-do-not-send="true">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" moz-do-not-send="true">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"
                                  moz-do-not-send="true">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"
                                  moz-do-not-send="true">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"
                        moz-do-not-send="true">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" moz-do-not-send="true">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" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
                    </blockquote>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
    </blockquote>
  </body>
</html>