postgres
postgres copied to clipboard
Unexpected token JSON
Hi, Guys!
I have an issue with query like this:
SELECT i.*,
array_agg(m.name) as motifs,
array_agg(m.global_art_style) as global_art_style,
array_agg(m.styles) as styles
FROM public."Location" as i
LEFT JOIN public."Motif" AS m ON m.location = i.id
WHERE 1=1
GROUP BY i.id
ORDER BY id ASC
Inside array_agg fields I have text with possible NULL values, it is fine in PgAdmin and I see just NULL values, but with your library the query is failed with error:
Unexpected token N in JSON at position 0
Same issue when array_agg is used on JSON column with null value.
Another probably not related issue, bool[] paramaters do not work.
await sql
SELECT ${[true, false]}::bool[];
PostgresError: cannot cast type boolean to boolean[]