identity column
A column whose values the database generates automatically for each new row, typically a numeric key.
In more detail
PostgreSQL declares it with the standard generated always as identity clause, which replaces the older serial keyword still seen in older articles. In SQLite an INTEGER PRIMARY KEY column is filled automatically in the same way.
Example
id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEYRelated terms
- primary key — The column, or columns, whose value uniquely identifies each row of a table and can never be NULL.
- INTEGER — The column type for whole numbers, used in this course for keys, quantities and money stored in cents.
- PostgreSQL — A widely used open source relational database server with strict typing, rich data types and extensions.
Taught in
- Data Types And What To Choose — PostgreSQL, Indexing & Relational Data Modeling