PostgreSQL IsIdentity is creating the PK the old way?
See original GitHub issueDescribe the question
When I’m creating a new table for my PostgreSQL v12.2 and I set the IsIdentity property to true for the PK the column is created as serial NOT NULL
. This is the old way of creating PK in PostgreSQL (before v10) and the new way is int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY
Do you know how can I set this option so the PK can be created by the new way?
Information (please complete the following information):
- OS: Windows 10
- Platform: .NET Core 3.1
- FluentMigrator version: 3.2.6
- FluentMigrator runner: “in-process runner”
- Database Management System: Postgres v12.2
Issue Analytics
- State:
- Created 3 years ago
- Comments:10
Top Results From Across the Web
PostgreSQL 10 identity columns explained
CREATE TABLE test_old ( id serial PRIMARY KEY, payload text ); INSERT INTO ... A general problem with the old way is that...
Read more >Why does Postgres generate an already used PK value?
DETAIL: Key (id)=(1) already exists. My Postgres database does in fact have a myapp_mymodel object with the primary key of 1. Why would...
Read more >PostgreSQL Identity Column
This tutorial shows you how to use the GENERATED AS IDENTITY constraint to create the PostgreSQL identity column for a table.
Read more >Better to use SERIAL PRIMARY KEY or GENERATED ...
The GENERATED AS IDENTITY constraint is the SQL standard-conforming variant of the good old SERIAL column. In the example they use the identity...
Read more >Auto-generated primary keys: UUID, serial or identity column?
This article explores the old question what to use for autogenerated primary keys: UUID, serial or identity column?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@KrisPetkov Is this causing an error, or is this a stylistic change you prefer?
Thank you as well for the great discussion! You help make projects like these worth the effort!