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 18:48:37
Message-ID: CAADeyWhoauMGRhiahZW1jxocBxyyTw-7S55gEC6MZVAvrDV6Zw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Oops, I've got strings there too - when swapping instead of playing tiles:

# select * from words_moves where gid=609 and action <> 'play';
mid | action | gid | uid | played | tiles |
score
------+--------+-----+------+-------------------------------+----------+-------
1063 | swap | 609 | 1192 | 2018-03-02 14:13:24.684301+01 | "ТСНЦУЭ" |
¤
1067 | swap | 609 | 1192 | 2018-03-02 15:31:14.378474+01 | "ЕЯУЕФП" |
¤
1068 | swap | 609 | 7 | 2018-03-02 15:52:07.629119+01 | "ОЕЕАУ" |
¤
1072 | swap | 609 | 7 | 2018-03-02 16:06:43.365012+01 | "ЕЕЫ" |
¤
1076 | swap | 609 | 7 | 2018-03-02 16:20:18.933948+01 | "Ъ" |
¤
(5 rows)

So my problem was simple. I am sorry for the numerous mails!

(it is just such a long chain - android/html5 - Jetty - PostgreSQL, so that
sometimes I am confused.
At least I am glad to have most of my logic as Pl/pgSQL right at the data)

Regards
Alex

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2018-03-02 18:52:03 Re: jsonb_array_length: ERROR: 22023: cannot get array length of a scalar
Previous Message Alexander Farber 2018-03-02 18:43:12 Re: jsonb_array_length: ERROR: 22023: cannot get array length of a scalar