On Sep 8, 2008, at 3:56 PM, Diez B. Roggisch wrote:
> > This does fail with the same error - the :: isn't properly > recognized. I > tried to escape as you said: > > select([literal_column(r"count(*)\:\:float")], > and_(at.c.question_id == > qt.c.id)).as_scalar() can't reproduce. Here's a test case tested against the current 0.4 and 0.5 trunks: from sqlalchemy import * engine = create_engine('postgres://scott:[EMAIL PROTECTED]/test', echo=True) foo = Table("foo", MetaData(engine), Column('data', String(50))) foo.create(checkfirst=True) engine .execute(select([literal_column("count(*)::float")]).select_from(foo)) output: 2008-09-08 16:40:56,584 INFO sqlalchemy.engine.base.Engine.0x..d0 select relname from pg_class c join pg_namespace n on n.oid=c.relnamespace where n.nspname=current_schema() and lower(relname)=%(name)s 2008-09-08 16:40:56,585 INFO sqlalchemy.engine.base.Engine.0x..d0 {'name': 'foo'} 2008-09-08 16:40:59,962 INFO sqlalchemy.engine.base.Engine.0x..d0 SELECT count(*)::float FROM foo 2008-09-08 16:40:59,962 INFO sqlalchemy.engine.base.Engine.0x..d0 {} --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---