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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
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:52:03
Message-ID: CAKFQuwZ7JumHOpbsKH=2qsa6iL2XYnYGz2qYFomXz72sf6j14Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Mar 2, 2018 at 11:48 AM, Alexander Farber <
alexander(dot)farber(at)gmail(dot)com> wrote:

> Oops, I've got strings there too - when swapping instead of playing tiles:
>
>
​You should probably add:

jsonb_array_length(tiles) > 0

as a check constraint on column

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2018-03-02 18:52:32 Re: jsonb_array_length: ERROR: 22023: cannot get array length of a scalar
Previous Message Alexander Farber 2018-03-02 18:48:37 Re: jsonb_array_length: ERROR: 22023: cannot get array length of a scalar