Re: Auto-partitioning? - Mailing list pgsql-general

From Steve Wampler
Subject Re: Auto-partitioning?
Date
Msg-id 46CB4F1B.4040903@noao.edu
Whole thread Raw
In response to Auto-partitioning?  (Steve Wampler <swampler@noao.edu>)
Responses Re: Auto-partitioning?  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-general
Steve Wampler wrote:
> ... Specifically, I'm wondering if it's
> possible to add a default rule that would create a new partition
> (with indices, etc.) and would add a new rule for this partition
> to match the similar ones above (and, of course, then move the
> INSERT into the new partition).

I think I've answered my own question, but would love an expert
to validate the answer:

   The answer is "no", apparently because 'name' in

      CREATE RULE name ...

   can't be an expression.  So there's no way to dynamically create a
   sequence of rules because you can't create new rule names inside
   the body of the 'default' rule.  Ergo, no way to to auto-partitioning.

Is that correct?  Is that the only reason, or is 'create rule...'
simply not something that can be done inside another 'create rule...'?

It's possible to have a 'default' rule (of sorts) by taking advantage
of the alphabetic order of rule application, but that rule is unable
to produce new rules.  Pity.

Thanks,
Steve
--
Steve Wampler -- swampler@noao.edu
The gods that smiled on your birth are now laughing out loud.

pgsql-general by date:

Previous
From: Bill Thoen
Date:
Subject: PG Seg Faults Performing a Query
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Auto-partitioning?