Re: jsonb_array_length: ERROR: 22023: cannot get array length of a scalar

From: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
To:
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: jsonb_array_length: ERROR: 22023: cannot get array length of a scalar
Date: 2018-03-02 14:31:34
Message-ID: CAADeyWi1KErkf9=K_s+1jjR8Dai9n2-S9fGKQ1N4E0OJ0LmntQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

And here is how I call my stored function -

https://gist.github.com/afarber/88a832a1b90a8940764ad69b2b761914

- why wouldn't it store a jsonb array in the tiles column of words_moves
table?

2018-03-02 15:29:42.644 CET [16693] LOG: statement: DISCARD ALL
2018-03-02 15:29:42.644 CET [16693] LOG: duration: 0.015 ms
2018-03-02 15:30:33.645 CET [16693] LOG: statement: select 1
2018-03-02 15:30:33.645 CET [16693] LOG: duration: 0.094 ms
2018-03-02 15:30:33.645 CET [16693] LOG: statement: SET DateStyle='ISO';
2018-03-02 15:30:33.645 CET [16693] LOG: duration: 0.050 ms
2018-03-02 15:30:33.645 CET [16693] LOG: duration: 0.021 ms parse
<unnamed>: SET extra_float_digits = 3
2018-03-02 15:30:33.645 CET [16693] LOG: duration: 0.003 ms bind
<unnamed>: SET extra_float_digits = 3
2018-03-02 15:30:33.645 CET [16693] LOG: execute <unnamed>: SET
extra_float_digits = 3
2018-03-02 15:30:33.645 CET [16693] LOG: duration: 0.006 ms
2018-03-02 15:30:33.645 CET [16693] LOG: duration: 0.007 ms parse
<unnamed>: SET application_name = 'PostgreSQL JDBC Driver'
2018-03-02 15:30:33.645 CET [16693] LOG: duration: 0.002 ms bind
<unnamed>: SET application_name = 'PostgreSQL JDBC Driver'
2018-03-02 15:30:33.645 CET [16693] LOG: execute <unnamed>: SET
application_name = 'PostgreSQL JDBC Driver'
2018-03-02 15:30:33.645 CET [16693] LOG: duration: 0.005 ms
2018-03-02 15:30:33.646 CET [16693] LOG: duration: 0.110 ms parse
<unnamed>: SELECT out_uid AS uid, out_fcm AS fcm, out_apns AS apns,
out_adm AS adm, out_body AS body FROM words_play_game($1::int, $2::int,
$3::jsonb)
2018-03-02 15:30:33.646 CET [16693] LOG: duration: 0.058 ms bind
<unnamed>: SELECT out_uid AS uid, out_fcm AS fcm, out_apns AS apns,
out_adm AS adm, out_body AS body FROM words_play_game($1::int, $2::int,
$3::jsonb)
2018-03-02 15:30:33.646 CET [16693] DETAIL: parameters: $1 = '7', $2 =
'609', $3 =
'[{"col":0,"letter":"К","row":3,"value":2},{"col":0,"letter":"И","row":4,"value":1}]'
2018-03-02 15:30:33.646 CET [16693] LOG: execute <unnamed>: SELECT
out_uid AS uid, out_fcm AS fcm, out_apns AS apns, out_adm AS adm,
out_body AS body FROM words_play_game($1::int, $2::int, $3::jsonb)
2018-03-02 15:30:33.646 CET [16693] DETAIL: parameters: $1 = '7', $2 =
'609', $3 =
'[{"col":0,"letter":"К","row":3,"value":2},{"col":0,"letter":"И","row":4,"value":1}]'
2018-03-02 15:30:33.653 CET [16693] LOG: duration: 7.567 ms

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Farber 2018-03-02 14:42:05 Re: jsonb_array_length: ERROR: 22023: cannot get array length of a scalar
Previous Message Alexander Farber 2018-03-02 14:14:48 Re: jsonb_array_length: ERROR: 22023: cannot get array length of a scalar