Answers for "set sequence ot max postgres"

SQL
1

postgres set sequence value to max id

SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
Posted by: Guest on January-19-2021
0

update postgres sequence to max

SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)+1);
Posted by: Guest on February-25-2021

Code answers related to "set sequence ot max postgres"

Code answers related to "SQL"

Browse Popular Code Answers by Language