pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: YUriy Zhuravlev <u.zhuravlev@postgrespro.ru>
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> (raw)
In-Reply-To: <CA+TgmoapP=S0hmX9J3iLQh5rB86iVA8CEkAye9fMy87mLp3rZw@mail.gmail.com>
References: <2987745.PueTkqGxbO@dinodell>
	<563D659D.2020708@BlueTreble.com>
	<CA+TgmoapP=S0hmX9J3iLQh5rB86iVA8CEkAye9fMy87mLp3rZw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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



view thread (56+ messages)  latest in thread

Message-ID: <2140159.HH0D5mDkSl@dinodell>
Permalink:  ../2140159.HH0D5mDkSl@dinodell/
Also on:    postgresql.org/message-id/2140159.HH0D5mDkSl@dinodell

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: u.zhuravlev@postgrespro.ru
  Subject: Re: Some questions about the array.
  In-Reply-To: <2140159.HH0D5mDkSl@dinodell>
  References: <2987745.PueTkqGxbO@dinodell> <563D659D.2020708@BlueTreble.com> <CA+TgmoapP=S0hmX9J3iLQh5rB86iVA8CEkAye9fMy87mLp3rZw@mail.gmail.com> <2140159.HH0D5mDkSl@dinodell>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox