pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: John Lister <john.lister-ps@kickstone.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Partitioning by letter question
Date: Fri, 29 Jan 2010 16:50:31 -0700
Message-ID: <dcc563d11001291550j70867455q2f16fdf3a4a9cc4@mail.gmail.com> (raw)
In-Reply-To: <4B636022.90804@kickstone.com>
References: <4B636022.90804@kickstone.com>

On Fri, Jan 29, 2010 at 3:24 PM, John Lister
<john.lister-ps@kickstone.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')

?



view thread (4+ messages)  latest in thread

Message-ID: <dcc563d11001291550j70867455q2f16fdf3a4a9cc4@mail.gmail.com>
Permalink:  ../dcc563d11001291550j70867455q2f16fdf3a4a9cc4@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d11001291550j70867455q2f16fdf3a4a9cc4@mail.gmail.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: scott.marlowe@gmail.com, john.lister-ps@kickstone.com
  Subject: Re: Partitioning by letter question
  In-Reply-To: <dcc563d11001291550j70867455q2f16fdf3a4a9cc4@mail.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