Re: Some questions about the array. - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Some questions about the array.
Date
Msg-id CAFj8pRD50_=a4zqR1qfaM_Z7rQ4JCHm18UkwecB5CLSTtcDTCg@mail.gmail.com
Whole thread Raw
In response to Re: Some questions about the array.  (YUriy Zhuravlev <u.zhuravlev@postgrespro.ru>)
Responses Re: Some questions about the array.  (YUriy Zhuravlev <u.zhuravlev@postgrespro.ru>)
Re: Some questions about the array.  (Marc Mamin <M.Mamin@intershop.de>)
List pgsql-hackers


2015-11-09 12:36 GMT+01:00 YUriy Zhuravlev <u.zhuravlev@postgrespro.ru>:
On Sunday 08 November 2015 16:49:20 you wrote:
> I'm not necessarily objecting to that, but it's not impossible that it
> could break something for some existing user.  We can decide not to
> care about that, though.

We had an idea. You can use ~ to convert the index to the array which always
starts with 0. Then we can use negative indexes, and you can always find the
beginning of the array.
Example:
we have array [-3:3]={1,2,3,4,5,6,7}
array[~0] == 1
array[~-1] == 7
array[~2:~-2] == {3,4,5,6}

What do you think?

I am sorry - it is looking pretty obscure. Really need this feature?

Pavel
 
--
YUriy Zhuravlev
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: YUriy Zhuravlev
Date:
Subject: Re: Some questions about the array.
Next
From: Ashutosh Bapat
Date:
Subject: Re: Transactions involving multiple postgres foreign servers