Re: Cleaning up array_in()

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Nikhil Benesch <nikhil(dot)benesch(at)gmail(dot)com>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, jian he <jian(dot)universality(at)gmail(dot)com>
Subject: Re: Cleaning up array_in()
Date: 2023-11-08 15:00:00
Message-ID: e6151e0a-e8d0-2104-63d1-106c195b960d@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2023-11-08 15:10:51 XX000: tuple concurrently deleted during DROP STATISTICS
Previous Message Andrew Dunstan 2023-11-08 14:47:08 Re: Remove MSVC scripts from the tree