On Sep 28, 2011, at 9:47 AM, Chris Withers wrote: > On 28/09/2011 14:09, Michael Bayer wrote: >>> Hmm, but both mysql and postgres (I suspect others do too, but I haven't >>> checked) have "DROP TABLE IF EXISTS" statements so you don't need to do any >>> checking. That feels like it should be supported by the DropTable >>> construct, what am I missing? >> >> oh, that. Right you'd need to use @compiles to enhance a new subclass of >> DropTable to do that, as SQLA's compiler doesn't have the "IF EXISTS" >> feature present at the moment (it could be added). > > I guess it probably should, I think that one could legitimately be in > sqlalchemy itself ;-) > >> The "E" is how psycopg2 formats the %s -> table.name parameter in your >> statement for certain versions of Postgresql. I don't know what it actually >> means but if you watch your PG logs you'll see it's used for all bound >> parameters. > > Hmm, any ideas why it'd cause a syntax error here? > > I'm doing engine.execute('drop table if exists %s' + table.name) in the > meantime, which just feels icky...
oh probably it doesn't like table name as a bound parameter. > > Chris > > -- > Simplistix - Content Management, Batch Processing & Python Consulting > - http://www.simplistix.co.uk > > -- > 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. > -- 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.