postgresql nextval incorrect result

0

After restoring database I run next query

SELECT nextval('table_id_seq') 

and I must get max id + 1 something like (select max(id) + 1 from table), but instead I get just max id next time I call it result is correct. This issue happens only to two tables the rest works okay. I use PostgreSQL 10.

Any ideas what it can be.

Link: postgresql nextval incorrect result
Source: Stack Sql

Share.

About Author

Leave A Reply