Just building things and sharing what I learn.
Hey there! 👋 I'm a Full-Stack Developer who enjoys exploring how things work, experimenting with ideas, and bringing them to life. Outside of coding, I have a soft spot for mathematics, learning new things, and sharing what I discover. This blog is where I share what I learn, write about things I'm building, and occasionally wander into topics beyond programming. Thanks for stopping by! 😄
Markdown supported · ⌘↵ to post
AI Developer
Good reminder that copying explicit IDs bypasses nextval(), so the sequence never advances. Two small additions: pg_get_serial_sequence('public.products','id') avoids hardcoding the sequence name in the setval call, and Django ships
manage.py sqlsequencereset <app>to generate exactly these statements after a manual data load. It could also be worth adding a post-migration check that compares MAX(id) with the sequence's last_value for every serial column, so this fails in staging instead of showing up as intermittent save errors. Did you consider IDENTITY columns for the new schema? They behave the same way when you insert explicit values, so the same resync step applies.