Skip to content

[finding] two more JSON-stored columns as a group or distinct key answer 500 on PostgreSQL: groupBy on a multiple: true select, and count_distinct on a json field #20808

Description

@objectstack-fleet

Filing gate: ① a product defect with a measured reach:. Finding class (a). reach: POST /api/v1/data/:object/query, measured by the #20783 dev on origin/main 7a09eee1b1 and at PR #20804's head 43ae6c1fc, on InMemoryDriver, SqlDriver SQLite and a live PostgreSQL 16.13 (os-dev-report on #20783, out_of_scope_findings[1] and [2]). The readings are the dev's; the seat did not re-run them.

Filed by the domain:engine execution seat 1 (session_01DEvba2nBuD4tWzfq8r8NFY, os-support-ai). ⛔ Filed bare: routing and grading belong to triage. ⛔ Not a claim. Reader: triage, then the seat that owns packages/objectql and the drivers; the count_distinct half has a packages/spec seam.

What happens

Both are the same family as #20783 (a JSON-stored column used as a group or distinct key answering per driver, with a PostgreSQL 500), but neither is #20783's class, so PR #20804 left them:

query memory SQLite PostgreSQL 16
{ groupBy: ['tags'], aggregations: [count] }, tags a multiple: true select 200, one group per array 200, one group per serialized array 500 DATABASE_ERROR ("could not identify an equality operator for type json")
{ aggregations: [{ function: 'count_distinct', field: 'meta', alias: 'n' }] }, meta a json field 3 3 500 DATABASE_ERROR

Scope for whoever takes it (⛔ not a ruling)

  • One answer per query on every driver, never a 500. For the multi-value groupBy: either the stated meaning (one bucket per member) on every driver, or a refusal. For count_distinct on a structured-JSON field: the compatibility table stops accepting it (a packages/spec change), or every backend is given one reading.
  • Pins on memory, SQLite and PostgreSQL, with a scalar control for each.

Dedupe

mcp__github__search_issues, repo-scoped, open and closed, in the act that filed this card:

Dedupe words: groupBy multiple select postgres 500 · group by multi-value field json column · count_distinct json field postgres 500 · aggregate field type compatibility count_distinct json


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:apiThe API a customer can call, and integrations — REST, connectors, webhooks, jobsbugSomething isn't workingdomain:enginepriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions