Re: Cleaning up array_in() - Mailing list pgsql-hackers

From Alexander Lakhin
Subject Re: Cleaning up array_in()
Date
Msg-id e6151e0a-e8d0-2104-63d1-106c195b960d@gmail.com
Whole thread Raw
In response to Re: Cleaning up array_in()  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Cleaning up array_in()
List pgsql-hackers
Hello Tom,

08.11.2023 02:52, Tom Lane wrote:
> Comments?

Thank you for the update! I haven't looked into the code, just did manual
testing and rechecked commands given in the arrays documentation ([1]).
Everything works correctly, except for one minor difference:
INSERT INTO sal_emp
     VALUES ('Bill',
     '{10000, 10000, 10000, 10000}',
     '{{"meeting", "lunch"}, {"meeting"}}');

currently gives:
ERROR:  malformed array literal: "{{"meeting", "lunch"}, {"meeting"}}"
LINE 4:     '{{"meeting", "lunch"}, {"meeting"}}');
             ^
DETAIL:  Multidimensional arrays must have sub-arrays with matching dimensions.

not
ERROR:  multidimensional arrays must have array expressions with matching dimensions

It seems that this inconsistency appeared with 475aedd1e, so it's not new
at all, but maybe fix it or describe the error more generally. (Though it
might be supposed that "for example" covers slight deviations.)

[1] https://www.postgresql.org/docs/devel/arrays.html

Best regards,
Alexander



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Remove MSVC scripts from the tree
Next
From: Justin Pryzby
Date:
Subject: XX000: tuple concurrently deleted during DROP STATISTICS