Hi hackers,
While reviewing another patch [1] I came to an idea to try something stupid:
=# select '{1,2,3}' :: int[];
int4
---------
{1,2,3}
=# select '{1,2,3}' :: int[] :: jsonb[];
ERROR: cannot cast type integer[] to jsonb[]
=# select '[1,2,3]' :: jsonb;
jsonb
-----------
[1, 2, 3]
=# select '[1,2,3]' :: jsonb :: int[];
ERROR: cannot cast type jsonb to integer[]
Does anyone believe that this should work and/or would be convenient
if it worked? I can imagine cases when one would like to use array_*
functions for JSON(B) although personally I didn't encounter such a
case (yet?).
Thoughts?
[1]: https://postgr.es/m/CAEG8a3J41a4dpw_-F94fF-JPRXYxw-GfsgoGotKcjs9LVfEEvw%40mail.gmail.com
--
Best regards,
Aleksander Alekseev