Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvkmS-0005MW-Rh for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Nov 2015 11:38:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZvkmR-0002wa-Oc for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Nov 2015 11:38:35 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZvkmQ-0002vk-6k for pgsql-hackers@postgresql.org; Mon, 09 Nov 2015 11:38:34 +0000 Received: from newmail.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZvkmI-0000pi-Sb for pgsql-hackers@postgresql.org; Mon, 09 Nov 2015 11:38:32 +0000 Received: from dinodell.localnet (unknown [192.168.27.1]) by mail.postgrespro.ru (Postfix) with ESMTPSA id 00B1521C42AD for ; Mon, 9 Nov 2015 14:38:24 +0300 (MSK) From: YUriy Zhuravlev To: pgsql-hackers@postgresql.org Subject: Re: Some questions about the array. Date: Mon, 09 Nov 2015 14:36:53 +0300 Message-ID: <2140159.HH0D5mDkSl@dinodell> Organization: postgrespro User-Agent: KMail/4.14.10 (Linux/4.2.2-gentoo; KDE/4.14.13; x86_64; ; ) In-Reply-To: References: <2987745.PueTkqGxbO@dinodell> <563D659D.2020708@BlueTreble.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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? -- 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