psycopg2.errors.SyntaxError: syntax error at or near "autoincrement" LINE 3: id BIGINT…
- User
psycopg2.errors.SyntaxError: syntax error at or near "auto_increment" LINE 3: id BIGINT auto_increment primary key,
- Assistant
The error you are encountering is due to an incorrect syntax use in a PostgreSQL database operation via
psycopg2. PostgreSQL doesn't useauto_incrementto set a column as auto-incrementing. Instead, PostgreSQL uses serial data types or identity columns to auto-increment primary key values.If you come from a MySQL background or similar, it's easy to make this mistake since
auto_incrementis the keyword used in MySQL to define an auto-increment column.