Repository navigation
Description
Problem
Successful Postgres relation reads can merge distinct external IDs or round exact numeric amounts inside native array columns. The supported query path preserves the same values. These are native bigint[]/numeric[] columns, not JSON columns with inherently approximate numeric values.
Reproduction
Create a local invented fixture containing:
SELECT ARRAY[9007199254740992,9007199254740993]::bigint[] AS ids,
ARRAY[9007199254740993.123456]::numeric[] AS amounts;Read the relation through list, get or getMany, then query the same stored columns:
{"relation":{"ids":[9007199254740992,9007199254740992],"amounts":[9007199254740994]}}
{"query":{"ids":["9007199254740992","9007199254740993"],"amounts":["9007199254740993.123456"]}}The independent review exercised real Dev/Operations handlers on PGlite for list/get/getMany and query. Discovered-style element metadata was retained. Safe arrays, scalar numerics and null elements were controls. A native driver parser-only control also showed exact array codecs versus rounded JSONB parsing. Native end-to-end relation execution was not run, so production reachability is supported by shared source rather than claimed as an executed production test.
Cause and scope
Mapping treats every array as generic JSON and projects to_jsonb. JSON numeric parsing then rounds large elements before validation. Existing lossless bigint/numeric array parsers never see their native array type after that projection.
Use element-aware projection/decoding to preserve int8/numeric elements as strings. The review verified a SQL text-array control preserves these values. Retain nulls/dimensions and account for supported domain arrays without applying this conversion to unrelated arrays.
Arrays being typed unknown requires callers to narrow their structure; it does not justify two distinct exact source values becoming equal. No source data is modified.
Audited at ef3e790. Found and independently reproduced by separate GPT-6 Astra agents in Oh My Pi. Ordinary local product workflows only, with synthetic data and no live services.
Activity