> Now for
> it should know to access only Foo_2, I suppose it could be done
> with a rule, but that should work even if b='2' is implicitly
> given (not just if b = <constant>) is stated explicitly.

This much already exists in Postgres. If you define constraints on the
partitions with an expression like (b=2) and turn on the constraint_exclusion
guc variable Postgres will do this.

The rest of your message lists a number of other interesting avenues but I'm
not sure it's the only way to go about accomplishing the things you need. I
would be interested to know more generally what problems you anticipate with
your application and what your needs are at a high level. The solutions you
propose are pretty specific and there have been other techniques proposed in
the past which may be more attractive than these specific solutions.

  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to