Skip to content

EclipseLink generates invalid PostgreSQL DDL (INTEGER SERIAL NOT NULL) #2616

@pardhiv-krishna

Description

@pardhiv-krishna

When using EclipseLink 5.0.0-B12 or 5.0.0-B13 or 4.0.9 with PostgreSQL, schema generation for entities with @GeneratedValue(strategy = GenerationType.IDENTITY) produces invalid DDL. Specifically, EclipseLink generates:

CREATE TABLE WLPParticipant (
  ID INTEGER SERIAL NOT NULL,
  "FIRST" VARCHAR(255),
  "LAST" VARCHAR(255),
  PRIMARY KEY (ID)
);

PostgreSQL rejects this with:

ERROR: syntax error at or near "SERIAL"

Expected behavior: EclipseLink should generate either ID SERIAL PRIMARY KEY or ID INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, which are valid PostgreSQL construct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions