From: Alban Hertroys <haramrae@gmail.com>
To: ramsiddu007 <ramsiddu007@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Empty Range Bound Specified for Partition
Date: Thu, 22 Nov 2018 09:00:28 +0100
Message-ID: <1E90D2FB-9C3A-4741-8997-A65E77067B34@gmail.com> (raw)
In-Reply-To: <CA+zEy78o0=uJKxDTyUrQMzUT0jsHZLkZqiSaho+GhvsNqA=c7Q@mail.gmail.com>
References: <CA+zEy78o0=uJKxDTyUrQMzUT0jsHZLkZqiSaho+GhvsNqA=c7Q@mail.gmail.com>
> On 22 Nov 2018, at 7:21, ramsiddu007 <ramsiddu007@gmail.com> wrote:
>
> pgsql> create table test_upto_100 partition of test_parent_partition
> for values from ('51') to ('100');
>
> It was showing error like this..
>
> ERROR: empty range bound specified for partition "test_upto_100"
> DETAIL: Specified lower bound ('51') is greater than or equal to upper bound ('100').
> SQL state: 42P17
>
>
> I am not getting, please give me cause of this and solution.
Alphabetically, '1' comes before '5', so '100' comes before '51'.
Numerically, you would get what you intended, but you're not partitioning on numbers but on strings instead and those sort alphabetically: '1', '10', '100', '11', '2', '3', '51', etc.
Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.
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-general@postgresql.org
Cc: haramrae@gmail.com, ramsiddu007@gmail.com
Subject: Re: Empty Range Bound Specified for Partition
In-Reply-To: <1E90D2FB-9C3A-4741-8997-A65E77067B34@gmail.com>
References: <CA+zEy78o0=uJKxDTyUrQMzUT0jsHZLkZqiSaho+GhvsNqA=c7Q@mail.gmail.com> <1E90D2FB-9C3A-4741-8997-A65E77067B34@gmail.com>
* 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