pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Empty Range Bound Specified for Partition
3+ messages / 2 participants
[nested] [flat]

* Empty Range Bound Specified for Partition
@ 2018-11-22 06:21  ramsiddu007 <ramsiddu007@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: ramsiddu007 @ 2018-11-22 06:21 UTC (permalink / raw)
  To: pgsql-general

Dear Professionals,
                           Just i have installed "PostgreSQL 11.1". And i
have started to create partitions. I've created RANGE partition table as
like below.

pgsql> create table test_parent_partition(
item_id integer,
         item_name character varying,
         item_qty character varying)
             partition by range(item_qty);

pgsql>  create table test_upto_50 partition of test_parent_partition
              for values from ('0') to ('50');

Above 1st partition table was created. After that i have taken next step to
create another partition talbe. But while am creating another partition
table like below query.

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.

-- 
*Thanks & Best Regards:*
Ramanna Gunde

*Don't complain about the HEAT,*

*PLANT A .*

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Empty Range Bound Specified for Partition
@ 2018-11-22 08:00  Alban Hertroys <haramrae@gmail.com>
  parent: ramsiddu007 <ramsiddu007@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Alban Hertroys @ 2018-11-22 08:00 UTC (permalink / raw)
  To: ramsiddu007 <ramsiddu007@gmail.com>; +Cc: pgsql-general


> 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.





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Empty Range Bound Specified for Partition
@ 2018-11-22 09:10  ramsiddu007 <ramsiddu007@gmail.com>
  parent: Alban Hertroys <haramrae@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: ramsiddu007 @ 2018-11-22 09:10 UTC (permalink / raw)
  To: haramrae@gmail.com; +Cc: pgsql-general

Thank you for the clarification.

On Thu, 22 Nov 2018 at 13:30, Alban Hertroys <haramrae@gmail.com> wrote:

>
> > 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.
>
>

-- 
*Best Regards:*
Ramanna Gunde

*Don't complain about the HEAT,*

*PLANT A .*

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-11-22 09:10 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-11-22 06:21 Empty Range Bound Specified for Partition ramsiddu007 <ramsiddu007@gmail.com>
2018-11-22 08:00 ` Alban Hertroys <haramrae@gmail.com>
2018-11-22 09:10   ` ramsiddu007 <ramsiddu007@gmail.com>

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