Use a SQL-standard identity column instead of serial.
Section: Schemas, Tables, and Core DDL
Create identity column
sql
sql
CREATE TABLE events (
event_id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
payload jsonb NOT NULL
);Explanation
See summary for usage details.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Schemas, Tables, and Core DDL