Using PostgreSQL Identity Columns in Ecto SQL

When working with PostgreSQL and Elixir&rsquo;s Ecto ORM, you are likely using SERIAL columns for auto-incrementing primary keys. However, since PostgreSQL 10 (released in October 2017), there&rsquo;s a better way: IDENTITY columns. Why Identity Columns? Identity columns (GENERATED AS IDENTITY) are part of the SQL Standard and are the recommended approach for auto-incrementing keys in modern…