Re: [GENERAL] JSON to INT[] or other custom type

2017-06-12 Thread Rory Campbell-Lange
On 11/06/17, Bruno Wolff III (br...@wolff.to) wrote: > On Sun, Jun 11, 2017 at 22:35:14 +0100, > Rory Campbell-Lange wrote: > > > >I'm hoping, in the plpgsql function, to unfurl the supplied json into a > >custom type or at least an array of ints, and I can't work out

Re: [GENERAL] JSON to INT[] or other custom type

2017-06-11 Thread David G. Johnston
On Sun, Jun 11, 2017 at 2:35 PM, Rory Campbell-Lange < r...@campbell-lange.net> wrote: > I'm hoping, in the plpgsql function, to unfurl the supplied json into a > custom type or at least an array of ints, and I can't work out how to do > that. ​You will be unable to cast the array itself. You

Re: [GENERAL] JSON to INT[] or other custom type

2017-06-11 Thread Bruno Wolff III
On Sun, Jun 11, 2017 at 22:35:14 +0100, Rory Campbell-Lange wrote: I'm hoping, in the plpgsql function, to unfurl the supplied json into a custom type or at least an array of ints, and I can't work out how to do that. select * from json_array_elements_text('[[0,

[GENERAL] JSON to INT[] or other custom type

2017-06-11 Thread Rory Campbell-Lange
I'm playing with plpgsql function parameters to try and come up with a neat way of sending an array of arrays or array of custom types to postgres from python and PHP. Psycopg works fine with an array of custom types: In [108]: query = 'select * from fn_test03(%s, %s::dow_session[])' In