January 2019
Beginner
556 pages
14h 19m
English
Serial types and identity columns are used to define surrogate keys. The synopsis for defining a column as an identity column is as follows:
GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ ( sequence_options ) ]
It's better to use identity columns, which were introduced in PostgreSQL 10, rather than serial, because this overcomes some of the serial type's limitations:
Read now
Unlock full access