Skip to content

Does not work with identity columns in Postgres #199

@kawpii

Description

@kawpii

Bug report

Describe the bug

If you have identity column in a table you will get error like

error: relation "app_public.app_public.demo_id_seq" does not exist

To Reproduce

Create a table like below

CREATE TABLE IF NOT EXISTS app_public.demo
(
    id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
   name TEXT NOT NULL
 );

Follow instructions given here, there with npx tsx seed.ts you will get an error.

Expected behavior

Support identity columns in Postgres even though there is not visible sequence created by Postgres with identity columns unlike serial columns. (identity sequences are manged internally by Postgres)

System information

  • OS: Linux fedora 6.10.7-200.fc40.x86_64
  • Version of Node.js: v20.11.1

Additional context

https://www.postgresql.org/docs/17/ddl-identity-columns.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions