Skip to content

Value sets read a ragged nest of empty arrays as {}, which PostgreSQL refuses #231

Closed

Description

@CaffeinatedCoder

Problem

Value sets read a ragged nest of empty arrays as {}, although PostgreSQL 16, 17 and 18 all refuse it (malformed array literal):

  • Int32Set.Parse("{{{},{}},{{}}}") → {}
  • Int32Set.Parse("{{{}},{{},{}}}") → {}

PostgreSQL 17 and 18 accept {{{},{}},{{},{}}} and {{{{}}},{{{}}}}: every sub-array at one level must hold the same number of entries, not only reach the same depth. SetFormat.IsNestOfEmptyArrays (near line 163) compares depth only. This affects every value set type and every entry point through SetFormat: Parse, TryParse, TypeConverter and the EF JSON document reader. Found by the pre-tag analysis (#179), part B. New in 10.0.0 (#128), so nothing has shipped. It accepts silently where PostgreSQL refuses.

Change

Have the depth walk return per-level counts and refuse siblings whose counts differ.

Done when

Both ragged literals are in the rejected rows of NestedEmptyArrays_ReadAsPostgres17AndLaterReadThem_AndPostgres16Rejects and SetDimensionDecorationTests. {{{},{}},{{},{}}} is in the accepted rows. The tests fail with the depth-only check restored.

Activity

  1. added this to the 10.0.0 milestone on Oct 18, 2026
  2. added
    bug
    silent
    area/value-sets
    area/literals
    package/core
    severity/low
    on Oct 18, 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

    area/literalsarea/value-setsbugpackage/coreseverity/lowsilent

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions