Loading topic
CREATE TABLE and INSERT statements and know what a primary key is. You should also know the integer types smallint, integer and bigint. The previous chapter introduced sequences and nextval. This chapter shows how serial builds on them, so that 5 min readCREATE TABLE, INSERT and SELECT statements. It also assumes you know what a primary key is and the ranges of smallint, integer and bigint. You should have a rough idea of what commit and rollback do. The chapter needs PostgreSQL 10 or later, the f5 min readCREATE TABLE and INSERT statements, know what a primary key is, and know the integer types. It also assumes you have seen the basic GENERATED ... AS IDENTITY syntax from the previous chapter. Here you will learn the one choice that syntax asks you to make: wh5 min readCREATE TABLE, INSERT and SELECT statements. It also assumes you know what a primary key is and have a rough idea of how transactions commit and roll back. You should have seen how a GENERATED ... AS IDENTITY column fills in its own value. Here you lea6 min readCREATE TABLE and INSERT statements and know what a primary key is. It also assumes you know the difference between GENERATED ALWAYS and GENERATED BY DEFAULT, covered in the previous chapter. It covers the two OVERRIDING clauses of INSERT, what they do i6 min readCREATE TABLE, INSERT and SELECT. It also assumes you know what a primary key is and have read the earlier chapters on GENERATED ALWAYS and GENERATED BY DEFAULT, and on OVERRIDING SYSTEM VALUE.6 min readGENERATED AS IDENTITY column is declared. The column type you pick for an identity column decides how many IDs you can ever hand out. It also affects index size and the cost6 min readGENERATED ALWAYS and GENERATED BY DEFAULT, and you know the ranges of smallint, integer and bigint. It covers the options you can put in parentheses after AS IDENTITY. These options configure the hidd5 min readCOMMIT and ROLLBACK. It explains why the IDs in an identity column are not a gapless counter, and what to do when you need one.6 min readGENERATED ALWAYS and GENERATED BY DEFAULT, and you know that an identity column is backed by a sequence. Here you will change an existing identity column without recreating the table.4 min readGENERATED ALWAYS and GENERATED BY DEFAULT, and you have seen OVERRIDING SYSTEM VALUE in the previous chapters. It also assumes you know that an identity column is backed by a sequence.5 min readGENERATED ALWAYS and GENERATED BY DEFAULT, and know why sequence values can have gaps. It covers the cases where an identity column is the wrong choice, or only part of the answer, and what to use in those cases.6 min read