Re: jsonb_array_length: ERROR: 22023: cannot get array length of a scalar - Mailing list pgsql-general

From Alexander Farber
Subject Re: jsonb_array_length: ERROR: 22023: cannot get array length of a scalar
Date
Msg-id CAADeyWgYKKaArJb6JK_xEtSO=7aeNaYqBu_ef-D5W7s8EFPfpQ@mail.gmail.com
Whole thread Raw
In response to Re: jsonb_array_length: ERROR: 22023: cannot get array length of ascalar  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: jsonb_array_length: ERROR: 22023: cannot get array length of a scalar  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: jsonb_array_length: ERROR: 22023: cannot get array length of ascalar  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
I see, thank you for your comments, David and Adrian.

In the "tiles" column actually save either the JSON array of tiles - when the user plays them

Or a string (which is jsonb too) concatenated of letters - when the user swaps the letters.

Maybe I should rethink my table structure (I just want to "log" all plays, swaps, skips, resigns in the words_moves table)...

Or maybe I should always check for the "action" column first (acts as enum) - before accessing "tiles" column....

Regrads
Alex

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: jsonb_array_length: ERROR: 22023: cannot get array length of ascalar
Next
From: Gary M
Date:
Subject: Is there a continuous backup for pg ?