could not determine data type of parameter $1
I am trying to nest PG functions array_agg and json_build_object
I tried like this
However, i receive an error from Postgres
Looking at the compiled query,
Why are val values parameterized since they are pretty much static ?
Why is postgres complaining about the type thing ?
Thank you.
I tried like this
However, i receive an error from Postgres
could not determine data type of parameter $1Looking at the compiled query,
val("foo_col") seems to be replaced by $1 then applied as first param. Why are val values parameterized since they are pretty much static ?
Why is postgres complaining about the type thing ?
Thank you.
Solution
Ok, perplexity gave me the answer.
You have to cast the key names à string with
You have to cast the key names à string with
cast(val("foo_col"), "text")