Skip to content

Commit 8bb197e

Browse files
committed
fix: cast jsonb_array_length result to BIGINT for Postgres compatibility
1 parent 0e14fbd commit 8bb197e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/server/query_remapper_function.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func CreatePgCatalogMacroQueries(config *Config) []string {
4242
ELSE json_extract_path_text(from_json, path_elems)::varchar
4343
END`,
4444
`CREATE MACRO jsonb_object_agg(key, value) AS to_json(map(array_agg(key), array_agg(value)))`,
45-
`CREATE MACRO jsonb_array_length(json) AS json_array_length(json)`,
45+
`CREATE MACRO jsonb_array_length(json) AS CAST(json_array_length(json) AS BIGINT)`,
4646
`CREATE MACRO jsonb_pretty(json) AS json_pretty(json)`,
4747
`CREATE MACRO json_array_elements(json) AS unnest(json_extract(json, '$[*]'))`,
4848
`CREATE MACRO jsonb_array_elements(json) AS unnest(json_extract(json, '$[*]'))`,

0 commit comments

Comments
 (0)