From 57e0875392f971990c7a53f21e6df9c27fb28a07 Mon Sep 17 00:00:00 2001 From: Najuna Brian Date: Fri, 31 Jul 2026 00:09:07 +0300 Subject: [PATCH] fix numeric fields exporting as null in parquet export casts to double precision instead of numeric, since lib/pq doesn't decode numeric and was returning raw bytes, which failed the float64 type assertion and got silently nulled. fixes #707 --- synkronus/pkg/dataexport/postgres.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synkronus/pkg/dataexport/postgres.go b/synkronus/pkg/dataexport/postgres.go index 53532c33e..ff51d3f41 100644 --- a/synkronus/pkg/dataexport/postgres.go +++ b/synkronus/pkg/dataexport/postgres.go @@ -148,7 +148,7 @@ func (p *postgresDB) GetObservationsForFormType(ctx context.Context, formType st for _, col := range schema.Columns { switch col.SQLType { case "numeric": - selectParts = append(selectParts, fmt.Sprintf("(data ->> '%s')::numeric AS data_%s", col.Key, col.Key)) + selectParts = append(selectParts, fmt.Sprintf("(data ->> '%s')::double precision AS data_%s", col.Key, col.Key)) case "boolean": selectParts = append(selectParts, fmt.Sprintf("(data ->> '%s')::boolean AS data_%s", col.Key, col.Key)) case "adate":