-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for identity columns in PostgreSQL 10+
Since PostgreSQL 10 the preferred method of defining auto increment columns is to use SQL standard identity columns instead of SERIAL psedo-types COLUMN TYPE GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ ( sequence_options ) ] See https://www.postgresql.org/docs/10/static/sql-createtable.html It fixes issues with SERIAL psudo-types: - CREATE TABLE / LIKE copies default but refers to same sequence - cannot add/drop serialness with ALTER TABLE - dropping default does not drop sequence - need to grant separate privileges to sequence - other slight weirdnesses because serial is some kind of special macro As explained by author of the patch in https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=3217327053638085d24dd4d276e7c1f7ac2c4c6b
- Loading branch information
1 parent
00af3e3
commit 3cad372
Showing
3 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters