Skip to content

Value set literals refuse array_in's dimension decoration ([1:1]={…}) and {{}} #128

Closed

Description

@CaffeinatedCoder

Value set literals refuse two array literals PostgreSQL's array_in reads as a one-dimensional array: the dimension decoration [lower:upper]= and the nested empty {{}}. Loud (FormatException). Measured on main (3ecfa10) against PostgreSQL 17.10:

Int32Set.Parse("[1:1]={1}", null);     // FormatException: not a valid array literal
StringSet.Parse("[0:1]={a,b}", null);  // FormatException
Int32Set.Parse("{{}}", null);          // FormatException
SELECT '[1:1]={1}'::int[], array_lower('[0:1]={1,2}'::int[], 1), '{{}}'::int[];   -- {1} | 0 | {}

Every value set type. Found by LiteralCorpusProbeTests (#123), family dimensions. A real two-dimensional literal ({{1},{2}}) is refused on purpose and agrees.

Authority. docs/value-sets.md#parse-and-print-literals: "The grammar is PostgreSQL's array_in." (claim S12). array_out prints the decoration whenever the lower bound is not 1, so a column written by another tool ('[0:1]={1,2}') prints text the library cannot read back.

Options. Read the decoration and drop it (a set has no index), and read {{}} as empty; or document both as refused next to S12.

Activity

  1. added
    bugSomething isn't working
    found-by/oracleFound by the generated-oracle machinery (claims × API surfaces)
    area/value-setsValue set families and wrapper arities
    area/literalsParse, TryParse and formatting
    package/coreAffects CodoMetis.ValueRanges
    severity/lowCosmetic, message or documentation-level difference
    on Oct 17, 2026
  2. CaffeinatedCoder commented on Oct 17, 2026

    @CaffeinatedCoder
    OwnerAuthor

    The same refusal holds for {{},{}}, which array_in also reads as {}. LiteralCorpusProbeTests (#123) registers [1:1]={a}, [0:1]={a,b}, {{}} and {{},{}} as family dimension decoration for all 28 value set types; a real two-dimensional literal is refused on both sides and agrees.

  3. added this to the 10.0.0 milestone 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/literalsParse, TryParse and formattingarea/value-setsValue set families and wrapper aritiesbugSomething isn't workingfound-by/oracleFound by the generated-oracle machinery (claims × API surfaces)package/coreAffects CodoMetis.ValueRangesseverity/lowCosmetic, message or documentation-level difference

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions