serial (TP007)#
Automatic fix is available.
What it does#
Checks for usage of serial types.
Why not?#
The serial types have some weird behaviors that make schema, dependency, and permission management unnecessarily cumbersome.
When should you?#
- If you need support to PostgreSQL older than version 10.
- In certain combinations with table inheritance (but see there)
- More generally, if you somehow use the same sequence for multiple tables, although in those cases an explicit declaration might be preferable over the serial types.
Use instead:#
For new applications, identity columns should be used.