Filing gate: ① a defect with a named landing site: SqlDriver.aggregate on PostgreSQL, packages/drivers/driver-sql/src/sql-driver.ts. node-pg hands bigint (count) and numeric (sum, avg) back as strings, and the native aggregate path presents them as it receives them. The consumer is applyHaving in packages/objectql.
Finding class (a). reach: was measured at the public REST door (below).
The domain:engine execution seat 1 (session_01Bvd69VPa6puiNzzPUroDBx) filed this from its #20263 dev's report (os-dev-report 5859428680, out_of_scope_findings[2]), re-measured by the at-tier review of PR #20307 (record 5860498332). PR #20202's acceptance note had recorded the string count (carrier none) before a wrong answer was measured. ⛔ Filed bare: routing and grading are triage's. ⛔ Not a claim.
What happens
Measured at 2dccb7d494, which equals main on this path, through engine.aggregate and REST POST /api/v1/data/:object/query, with groupBy customer over four groups, c1 to c4.
|
memory |
SQLite |
PostgreSQL rows path |
PostgreSQL native path |
| the aggregated record |
"n": 1, "total": 20 |
numbers |
numbers |
"n": "1", "total": "20.000000000000000000000000000000", "mean" a string |
having { n: { $in: [2] } } |
c1, c2 |
c1, c2 |
c1, c2 |
none |
having { total: { $in: [500, 20] } } |
c1, c4 |
c1, c4 |
c1, c4 |
none |
having on count / sum / avg with $lt "not-a-date" or $gt an extended-year ISO |
none |
none |
none |
c1–c4 |
- One
having answers differently on one dialect, and on one path of that dialect, depending on whether the native aggregate or the in-memory aggregation produced the row.
- The REST response itself carries strings where the other dialects carry numbers.
Suggested shape (⛔ not a ruling)
- Present the native aggregate's numeric results as numbers on PostgreSQL (
count → number; sum / avg → number, with the precision policy decided once), so that the native and rows paths and all dialects agree.
- Check MySQL's
SUM / AVG (DECIMAL) in the same pass.
- Pin
having $in / $eq on count / sum / avg across both paths on SQLite, PostgreSQL and MySQL.
Filing-gate answers
Dedupe words: postgres aggregate count string · pg sum avg numeric string having $in · driver-sql native aggregate numeric type
Filing gate: ① a defect with a named landing site:
SqlDriver.aggregateon PostgreSQL,packages/drivers/driver-sql/src/sql-driver.ts. node-pg handsbigint(count) andnumeric(sum,avg) back as strings, and the native aggregate path presents them as it receives them. The consumer isapplyHavinginpackages/objectql.Finding class (a).
reach:was measured at the public REST door (below).The
domain:engineexecution seat 1 (session_01Bvd69VPa6puiNzzPUroDBx) filed this from its #20263 dev's report (os-dev-report5859428680,out_of_scope_findings[2]), re-measured by the at-tier review of PR #20307 (record 5860498332). PR #20202's acceptance note had recorded the stringcount(carrier none) before a wrong answer was measured. ⛔ Filed bare: routing and grading are triage's. ⛔ Not a claim.What happens
Measured at
2dccb7d494, which equalsmainon this path, throughengine.aggregateand RESTPOST /api/v1/data/:object/query, withgroupBycustomer over four groups, c1 to c4."n": 1,"total": 20"n": "1","total": "20.000000000000000000000000000000","mean"a stringhaving { n: { $in: [2] } }having { total: { $in: [500, 20] } }havingoncount/sum/avgwith$lt "not-a-date"or$gtan extended-year ISOhavinganswers differently on one dialect, and on one path of that dialect, depending on whether the native aggregate or the in-memory aggregation produced the row.Suggested shape (⛔ not a ruling)
count→ number;sum/avg→ number, with the precision policy decided once), so that the native and rows paths and all dialects agree.SUM/AVG(DECIMAL) in the same pass.having$in/$eqoncount/sum/avgacross both paths on SQLite, PostgreSQL and MySQL.Filing-gate answers
domain:engine, the owner ofdriver-sql).closedincluded:postgres aggregate count sum avg returned as string numeric having $in→ service-analytics:AVG()over aField.datetimemeasure returns SQLite's text→numeric coercion (an average YEAR) with no error, andderived: { op: 'difference' }renders the difference of two of them as a clean plausible number #16737, No layer refuses an incoherent aggregate / field-type pair — a dataset measureavgover a datetime works on SQLite and errors on Postgres #16099 and Anumber/string/booleanmetric's SQL expression is replaced byCOUNT(*)#4157 (analytics measure types, all closed), none this.Dedupe words:
postgres aggregate count string·pg sum avg numeric string having $in·driver-sql native aggregate numeric type