session.execute() converts incoming strings to text() constructs so that SQLA's normalized bind parameter syntax ":somename" can be used. If you'd like to execute raw SQL using the native PG bind parameter format use session.connection().execute("my sql").
On Nov 10, 2008, at 6:48 AM, sector119 wrote: > > One more, why when I use sess.execute('CREATE SCHEMA %(s)s', {'s':s}), > not conn.execute('CREATE SCHEMA %(s)s', {'s':s}) I allways get > KeyError: s > Can I use execute() with session? > > On 10 Лис, 13:44, sector119 <[EMAIL PROTECTED]> wrote: >> Hi! >> >> I use PostgreSQL and when I try to create schema I use following >> command conn.execute('CREATE SCHEMA %(s)s', {'s':s}) >> >> I get raise exc.DBAPIError.instance(statement, parameters, e, >> connection_invalidated=is_disconnect) >> sqlalchemy.exc.ProgrammingError: (ProgrammingError) syntax error at >> or >> near "E'system'" >> LINE 1: CREATE SCHEMA E'system' >> >> Why it try to escape schema name and how to make it not to do >> that? :) >> >> Thanks a lot! > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---