On Oct 5, 2011, at 2:58 AM, rdunklau wrote: >> >> the correct value "t_id" is returned. > > I ran this exact same test on my postgresql 9.1.1 install, and it > fails.
OK then its a PG 9 thing. We had an almost identical issue involving indexes and this is likely the same thing, this bug can be tracked at http://www.sqlalchemy.org/trac/ticket/2291 . For the moment which you can work around with the manual Column. > >> we used information_schema many years ago. At least back then, its >> performance was orders of magnitude slower and it also does not return >> complete data. >> The information schema views are extremely slow for big reflection jobs. >> The PG tables also have information on PG specific features, which we need >> to get at: >> >> "The information schema views do not, however, contain information about >> PostgreSQL-specific features; to inquire about those you need to query the >> system catalogs or other PostgreSQL-specific views. " >> >> Most articles/howtos/help/documentation I've ever seen on the subject use >> the pg_ tables, some examples: >> >> http://crafted-software.blogspot.com/2011/03/get-all-column-names-of-...http://www.polak.ro/postgresql-select-tables-names.htmlhttp://www.alberton.info/postgresql_meta_info.html(illustrates >> using both INFO_SCHEMA and pg_ tables) >> >> I've also analyzed the queries emitted by the pgAdmin3 tool and it uses the >> pg_ tables. We've had lots of bugs with PG reflection and the system >> tables have always ultimately had the right information, though sometimes >> very hard to get at. > > Thank you for this comprehensive explanation. > >>> Does anyone have any workaround (besides the obvious: remap the table >>> manually) ? >> >> SQLAlchemy can attempt to work around the issue if a known workaround for >> the PG version in question is present, or alternatively you can provide the >> primary key column of the Table manually using the technique described >> athttp://www.sqlalchemy.org/docs/core/schema.html#overriding-reflected-.... > > I'll try that. > > -- > Ronan Dunklau -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@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.