Thanks for the tip! I solved it this way now and it works pretty well.
if True in [c.primary_key for c in tableName.c]: sequenceName = '%s_id_seq' % tableName Koen On Sep 9, 12:52 am, "Orest Kozyar" <[EMAIL PROTECTED]> wrote: > I don't know if SQLAlchemy has an easy way of determining this metadata, but > you can likely query the system tables directly. pg_attrdef stores this > information in the adbin/adsrc columns. You can parse the adsrc column to > get the sequence name. You can filter your query easily by table and/or > column. > Seehttp://www.postgresql.org/docs/8.2/interactive/catalog-pg-attrdef.htmlfor > more info. > > Hopefully someone else who knows SQLAlchemy better will know whether it's > possible to easily extract this info via metadata. > > Orest> -----Original Message----- > > From: sqlalchemy@googlegroups.com > > [mailto:[EMAIL PROTECTED] On Behalf Of Koen Bok > > Sent: Saturday, September 08, 2007 6:17 PM > > To: sqlalchemy > > Subject: [sqlalchemy] Get Table/Column Sequence Names > > > For sqlalchemy auto generated sequences (postgres) is there a > > nice way to find out: > > > - If a table/column has any > > - If so, what are the names > > > Thanks! Koen --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---