Skip to content

SERIAL is accepted in FIELDS (...) and rejected in the parenthesised column list #319

Description

@farhan-syah

Two CREATE COLLECTION surfaces disagree on whether SERIAL is a column type.

CREATE COLLECTION a FIELDS (n SERIAL, v TEXT);
-- CREATE COLLECTION

CREATE COLLECTION b (n SERIAL, v TEXT);
-- ERROR: parse error: unknown column type: 'SERIAL' (SQLSTATE 42601)

The parenthesised form is the PostgreSQL-shaped spelling and the one a user reaches for. BIGSERIAL behaves the same way.

Expected

Both surfaces accept the same column types, or the rejected one names why it differs.

Notes

SERIAL expansion lives in parse_fields_clause_from_pairs and parse_fields_clause in control/server/shared/ddl/schema_validation.rs. Both expand SERIAL to INT DEFAULT nextval('<collection>_<field>_seq'). The parenthesised column-list parser resolves column types elsewhere and never sees that expansion.

Activity

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

    area:sqlParser, planner, SQL semanticspriority:P2Scheduled, not urgentsev:4-lowMinimal impact / cosmetictype:bugA defect — broken, incorrect, or lost data

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions