Skip to content

sql: sequences should be automatically added to a table for postgres compatibility #26730

@BramGruneir

Description

@BramGruneir

This came out of hibernate's test suite, the following tests fail:

  • org.hibernate.engine.spi.ExtraStateTest shouldMaintainExtraStateWhenUsingIdentityIdGenerationStrategy
  • org.hibernate.id.CreateDeleteTest createAndDeleteAnEntityInTheSameTransactionTest
  • org.hibernate.id.FlushIdGenTest testPersistBeforeTransaction

Due to a sequence not existing.

create table ChineseTakeawayRestaurant (
  id  bigserial not null,
  gobelinStars int4 not null,
  primary key (id)
)
insert into ChineseTakeawayRestaurant (gobelinStars) 
  values 3

select currval('ChineseTakeawayRestaurant_id_seq')

Postgres automatically creates a sequence whenever a serial or big serial type is used. We don't do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sql-pgcompatSemantic compatibility with PostgreSQLA-tools-hibernateIssues that pertain to Hibernate integration.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions