django-planet
Oct. 20, 2022

Migrate PostgreSQL ID’s from serial to identity after upgrading to Django 4.1

published by Adam Johnson
in blog Adam Johnson
original entry Migrate PostgreSQL ID’s from serial to identity after upgrading to Django 4.1

The Django 4.1 release notes feature this short, innocent-looking note:

On PostgreSQL, AutoField, BigAutoField, and SmallAutoField are now created as identity columns rather than serial columns with sequences.

In this post, we’ll expand on what this means, why you might want to update existing columns from serial types …