Re: array_in sub function ReadArrayDimensions error message

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: array_in sub function ReadArrayDimensions error message
Date: 2024-07-09 15:40:08
Message-ID: CAKFQuwa0wACyFjaSKVbRf0PzR+C1XN5NVh3VXjGny+W4jCFUwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 9, 2024 at 8:31 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

>
> Here again, the problem is not a missing "=", it's invalid
> syntax somewhere before that.
>
> Another thing we could consider doing here (and similarly
> for your original case) is
>
> DETAIL: Expected "=" not "," after array dimensions.
>
> The advantage of this is that it provides a little more
> clarity as to exactly where things went wrong.
>
>
One possibility all this ignores is that what we are calling
array-dimensions are in reality most likely a user using json array syntax
in our SQL arrays. That seems eminently more likely than someone
mis-typing this niche incantation of building an array literal nowadays.
I'd add a hint if the first symbol is [ and we fail to get to the point of
actually seeing the equal sign or the first subsequent unquoted symbol is a
comma instead of a colon.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Antonin Houska 2024-07-09 15:55:58 Re: why there is not VACUUM FULL CONCURRENTLY?
Previous Message David E. Wheeler 2024-07-09 15:38:02 Re: jsonpath: Inconsistency of timestamp_tz() Output