lastval()

    Semantics

    • An error is raised if nextval() has not been called in the current session.

    Create two sequences and call for each of them.

    1. yugabyte=# CREATE SEQUENCE s1;
    1. CREATE SEQUENCE
      1. yugabyte=# SELECT nextval('s1');

      1. nextval

      1. 1

      (1 row)

        1. lastval

        (1 row)

        DROP SEQUENCE