Skip to content

Add Row pre-fills NULL for PostgreSQL identity columns (GENERATED ALWAYS AS IDENTITY); Set Value has no "Default" option #2588

Closed

Description

@honeybyhomo

What happened?

TablePro version: 0.69.0 (macOS, PostgreSQL 18, native connection)

What happens

On a table with:

CREATE TABLE bank_lookup (
    id integer GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    ...
);
  1. Add Row (⌘⇧N): the id cell shows NULL.
  2. Right-click the id cell → Set Value: only "Empty" is offered — no "Default".
  3. Columns with an explicit default (including DEFAULT NULL) correctly pre-fill as DEFAULT.
  4. Saving sends the id as NULL and fails:
ERROR: cannot insert a non-DEFAULT value into column "id"
DETAIL: Column "id" is an identity column defined as GENERATED ALWAYS.

Why (likely)

PostgreSQL reports identity columns with column_default = NULL — the generation lives in attidentity (information_schema is_identity/identity_generation), not in pg_attrdef. If the Add Row pre-fill and Set Value menu key off the column default only, identity columns fall through as "no default". The driver protocol's ColumnMetadata.identityKind (ALWAYS / BY DEFAULT) already carries this information.

Expected

Identity columns should pre-fill DEFAULT on Add Row and offer "Default" in Set Value. The plumbing exists: Duplicate Row already resets the PK to DEFAULT, and SQLStatementGenerator omits __DEFAULT__ columns from INSERTs — an identity column marked with that sentinel would produce the correct INSERT INTO t (cols…) VALUES (…) with the id column omitted.

Workaround

Duplicate Row (⌘⇧D) on an existing row — its PK is reset to DEFAULT — then edit cells and save.

Steps to reproduce

No response

Expected behavior

No response

Database type

None

TablePro version

No response

macOS version & chip

No response

Screenshots / Logs

No response

Activity

  1. added
    bug
    on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions