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: Nathan Bossart <nathandbossart(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Cleaning up array_in()
Date: 2023-05-09 11:00:01
Message-ID: e88ce5d0-bbcd-5e9c-8e66-34bc9f37e865@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

09.05.2023 06:06, Tom Lane wrote:
> Alexander Lakhin <exclusion(at)gmail(dot)com> writes:
>> The only thing that confused me, is the error message (it's not new, too):
>> select '{{{{{{{{{{1}}}}}}}}}}'::int[];
>> or even:
>> select '{{{{{{{{{{'::int[];
>> ERROR:  number of array dimensions (7) exceeds the maximum allowed (6)
> Yeah, I didn't touch that, but it's pretty bogus because the first
> number will always be "7" even if you wrote more than 7 left braces,
> since the code errors out immediately upon finding that it's seen
> too many braces.
>
> The equivalent message in the PLs just says "number of array dimensions
> exceeds the maximum allowed (6)". I'm inclined to do likewise in
> array_in, but didn't touch it here.

I think that, strictly speaking, we have no array dimensions in the string
'{{{{{{{{{{'; there are only characters (braces) during the string parsing.
While in the PLs we definitely deal with real arrays, which have dimensions.

>> Beside that, I would like to note the following error text changes
>> (all of these are feasible, I think):
> I'll look into whether we can improve those, unless you had a patch
> in mind already?

Those messages looked more or less correct to me, I just wanted to note how they are
changing (and haven't highlighted messages, that are not), but if you see here room
for improvement, please look into it (I have no good formulations yet).

Best regards,
Alexander

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2023-05-09 11:07:53 Re: Tables getting stuck at 's' state during logical replication
Previous Message shveta malik 2023-05-09 10:53:24 Re: Support logical replication of DDLs