Re: array_in sub function ReadArrayDimensions error message - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: array_in sub function ReadArrayDimensions error message
Date
Msg-id CAKFQuwa0wACyFjaSKVbRf0PzR+C1XN5NVh3VXjGny+W4jCFUwQ@mail.gmail.com
Whole thread Raw
In response to Re: array_in sub function ReadArrayDimensions error message  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: array_in sub function ReadArrayDimensions error message
List pgsql-hackers
On Tue, Jul 9, 2024 at 8:31 AM Tom Lane <tgl@sss.pgh.pa.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.

pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: jsonpath: Inconsistency of timestamp_tz() Output
Next
From: Antonin Houska
Date:
Subject: Re: why there is not VACUUM FULL CONCURRENTLY?