SERIAL
SERIAL is a SQL data type in the PostgreSQL Specific category. PostgreSQL auto-increment type. Creates an INTEGER column with a sequence. Equivalent to AUTO_INCREMENT in MySQL. The syntax is column SERIAL. It returns auto-incrementing integer. A typical example: CREATE TABLE users (id SERIAL PRIMARY KEY, name TEXT); INSERT INTO users (name) VALUES ('Alice'); -- id is auto-generated: 1, 2, 3... -- BIGSERIAL for 64-bit, SMALLSERIAL for small ranges A close relative is RETURNING, which postgreSQL extension that returns values from INSERT/UPDATE/DELETE statements (like OUTPUT in SQL Server). A close relative is ARRAY, which postgreSQL supports array columns and array operations. Can be multi-dimensional. A close relative is JSONB, which postgreSQL binary JSON type, more efficient than plain JSON. Supports indexing (GIN) and path queries. More about this category: PostgreSQL-specific features — SERIAL, RETURNING, ARRAY, JSONB, UPSERT. Related PostgreSQL Specific entries: RETURNING, ARRAY, JSONB, UPSERT (INSERT ON CONFLICT), ILIKE, BIGSERIAL / SMALLSERIAL, GENERATED AS IDENTITY, COPY.