Skip to content

Unknown sequence in DEFAULT raises 42601 instead of 42704 #313

Description

@EnRaiha

Summary

Unknown sequence in a DEFAULT expression raises SQLSTATE 42601
(plan error) today. PostgreSQL uses 42704 (undefined_object) for
nextval('missing'); the code already carries the message naming the
missing sequence, only the class is generic.

Scope

Five-file promotion path identified: error types variant, sequence_default
convert site, pgwire + gateway error maps, DDL dispatch check (~20 lines).

Related: #294 (tracked as out-of-scope candidate), #303

Reproduction

CREATE SEQUENCE s;
CREATE COLLECTION t (id BIGINT DEFAULT nextval('missing'), v TEXT) WITH (engine = 'kv');
INSERT INTO t (v) VALUES ('x');   -- SQLSTATE 42601 today; PostgreSQL: 42704

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:P3Backlog / somedaysev:4-lowMinimal impact / cosmetictype:featureNew capability or behavior change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions