Re: [HACKERS] Range Partitioning behaviour - query - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: [HACKERS] Range Partitioning behaviour - query
Date
Msg-id CAKFQuwab5=9nkUnzWubFYssowKDoo9eFG05LhVLq_kZ7kj4cyQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Range Partitioning behaviour - query  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: [HACKERS] Range Partitioning behaviour - query
Re: [HACKERS] Range Partitioning behaviour - query
List pgsql-hackers
On Thu, Feb 23, 2017 at 6:17 PM, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:
On 2017/02/24 8:38, Venkata B Nagothi wrote:
> On Thu, Feb 23, 2017 at 3:14 PM, Amit Langote wrote:
>> Upper bound of a range partition is an exclusive bound.  A note was added
>> recently to the CREATE TABLE page to make this clear.
>>
>> https://www.postgresql.org/docs/devel/static/sql-createtable.html
>
>
> Thanks. Actually, my confusion was that the upper bound value would be
> included when "TO" clause is used in the syntax.

Hmm, TO sounds like it implies inclusive.

​I think most common usage of the word ends up being inclusive but the word itself doesn't really care.​

Dictionary.com has a good example:

"We work from nine to five." - you leave at the beginning of the 5 o'clock hour (I'm going for casual usage here)

Since our implementation of ranges is half-open the usage here is consistent with that concept.  That it doesn't match BETWEEN is actually somewhat nice since you can use ranges for half-open and BETWEEN if you want to be concise with fully-closed endpoints.  But it is one more thing to remember.

David J.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] btree_gin and btree_gist for enums
Next
From: Amit Langote
Date:
Subject: Re: [HACKERS] Range Partitioning behaviour - query