In PostgreSQL we can create auto-incrementing columns using the serial
data type. The serial
type causes the column to be automatically populated with an auto-incrementing value each time a new row is inserted. The same applies for the smallserial
and bigserial
types.
This article provides an overview of how these data types work.
Continue reading