I have a DB (PostgreSQL of course) which has in the definition of one of its tables that the default is nextval(public.rr_id_seq'::text). When I look in the sequence I see that the "last_value" column is 40, but the largest value in the relevant column is 45. I tried using the SQL update command to update this value but it would not let me. How do I get rr_id_seq in step with the data in the table? David
David Goodenough wrote:
> I have a DB (PostgreSQL of course) which has in the definition of one of
> its tables that the default is nextval(public.rr_id_seq'::text). When I look
> in the sequence I see that the "last_value" column is 40, but the largest
> value in the relevant column is 45. I tried using the SQL update command
> to update this value but it would not let me. How do I get rr_id_seq in step
> with the data in the table?
SELECT setval('public.rr_id_seq', 46);
--
Richard Huxton
Archonet Ltd
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера