Re: Partitioning by letter question

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: John Lister <john(dot)lister-ps(at)kickstone(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Partitioning by letter question
Date: 2010-01-29 23:50:31
Message-ID: dcc563d11001291550j70867455q2f16fdf3a4a9cc4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Jan 29, 2010 at 3:24 PM, John Lister
<john(dot)lister-ps(at)kickstone(dot)com> wrote:
> Hi, I was wondering if this was possible. I'm trying to partition a table,
> which is straightforward enough thanks to the great documentation, but i
> have a question:
>
> If I partition using something like a product_id for example and have check
> constraints such as (id>=1000 and id<2000) then everything is fine and the
> planner correctly uses the right subset of the tables. However I would like
> to partition by the first letter and using something like this
> substr(word,1,1)='a' is ignored by the planner. From reading the docs I
> understand that complicated check constraints are ignored, but this doesn't
> seem overly complicated.
>
> Am i doing  something wrong or is there another better way to do this

Have you tried:

(word >= 'a' and word <'b')

?

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message John Lister 2010-01-30 15:04:34 Re: Partitioning by letter question
Previous Message John Lister 2010-01-29 22:24:34 Partitioning by letter question