5 | | **Usecase:** You could have a customer number, or invoice number in your code. Usually it is a good idea to not use a natural primary key, therefore reusing the pk as that number could be considered bad. Having a separate field with a separate sequence solves this issue. |
| 5 | The PostgreSQL documentation: https://www.postgresql.org/docs/9.1/static/datatype-numeric.html describes the field as follows: |
| 6 | |
| 7 | The data types `serial` and `bigserial` are not true types, but merely a notational convenience for creating unique identifier columns (similar to the AUTO_INCREMENT property supported by some other databases). |
| 8 | |
| 9 | **Use Cases:** |
| 10 | |
| 11 | 1. Anywhere an automatic incrementing value is required, but a primary key is often (mis)used. |
| 12 | 2. Providing additional (user controlled) auto-incrementing values. |
| 13 | |
| 14 | |
| 15 | The primary benefit is that is isolates the primary key for the sole use of maintaining referential integrity. |