Possible wart: q = select([Partition(t1,'my')]) q.append_column(Partition(t1,'my').c.data)
gives a from my,my (because of the alias heritage?). Is there a workaround here? On Sep 13, 2:17 pm, Gregg Lind <gregg.l...@gmail.com> wrote: > Thank you! > > I figured a compile visitor might be the right way in, but had no idea > of how to do it! > > Some tutorials just on the visitors would probably explain a lot about > how PG works! > > Cheers! > > GL > > On Sep 13, 2:14 pm, Michael Bayer <mike...@zzzcomputing.com> wrote: > > > > > On Sep 13, 2010, at 2:48 PM, Gregg Lind wrote: > > > > Suppose this is my table: > > > > a_table = Table( > > > 'a_table', metadata, > > > Column('ts',Integer, index=True, nullable=False), > > > Column('country',String, index=True, nullable=False), > > > Column('somestat',Integer,nullable=False), > > > PrimaryKeyConstraint('ts','country',name='summary_pk'), > > > ) > > > > then: > > > >>>> print select([a_table]).where(a_table.c.country=='de') > > > SELECT a_table.ts, a_table.country, a_table.somestat > > > FROM a_table > > > WHERE a_table.country = %(country_1)s > > > > Suppose further that in the Postgres, there are several PARTITIONS > > > INHERIT > > > from this main table, and I want to query them directly... what is a > > > sensible > > > way to do this? I can figure out *which* partition to use, based on > > > outside > > > code, so it doesn't need to be very smart. > > > > As a final answer I want something like: > > > >>>> print <SOMETHING> > > > SELECT a_table_PARITION1.ts, a_table_PARITION1.country, > > > a_table_PARITION1.somestat > > > FROM a_table_PARITION1 > > > WHERE a_table_PARITION1.country = %(country_1)s > > > > In my head, it is like "oh, use a_table, except sub in a new value > > > for > > > a_table.name TEMPORARILY". > > > this is not very hard so I created a recipe for this case: > > http://www.sqlalchemy.org/trac/wiki/UsageRecipes/PartitionTable > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "sqlalchemy" group. > > > To post to this group, send email to sqlalch...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > sqlalchemy+unsubscr...@googlegroups.com. > > > For more options, visit this group > > > athttp://groups.google.com/group/sqlalchemy?hl=en. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.