Identity columns
There are three auto incremented identity columns types in PostgreSQL
Name | Storage | Range |
SMALLSERIAL | 2 bytes | 1 to 32,767 |
SERIAL | 4 bytes | 1 to 2,147,483,647 |
BIGSERIAL | 8 bytes | 1 to 9,223,372,036,854,775,807 |
To create a new identity column use the following syntax
CREATE TABLE vehicle(
id SERIAL PRIMARY KEY,
name VARCHAR NOT NULL
);