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

From Heikki Linnakangas
Subject Re: Cleaning up array_in()
Date
Msg-id 01a01e88-de7b-d4b9-175a-a8699729243c@iki.fi
Whole thread Raw
In response to Re: Cleaning up array_in()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 08/07/2023 22:49, Tom Lane wrote:
> BTW, what's your opinion of allowing "[1:0]={}" ?  Although that was
> my proposal to begin with, I'm having second thoughts about it now.
> The main reason is that the input transformation would be lossy,
> eg "[1:0]={}" and "[101:100]={}" would give the same results, which
> seems a little ugly.

Hmm, yeah, that would feel wrong if you did something like this:

select ('[2:1]={}'::text[]) || '{x}'::text[];

and expected it to return '[2:2]={x}'.

I guess we could allow "[1:0]={}" as a special case, but not 
"[101:100]={}", but that would be weird too.

> Given the lack of field complaints, maybe we should leave that
> alone.
+1 to leave it alone. It's a little weird either way, so better to stay 
put. We can revisit it later if we want to, but I wouldn't want to go 
back and forth on it.

-- 
Heikki Linnakangas
Neon (https://neon.tech)




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cleaning up array_in()
Next
From: Tom Lane
Date:
Subject: Re: DecodeInterval fixes