[sqlalchemy] Re: complex query failing because of postgres type annotations.

2008-09-08 Thread Michael Bayer
On Sep 8, 2008, at 3:27 PM, Diez B. Roggisch wrote: But it fails with raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect) OperationalError: (OperationalError) unrecognized token: : ... text() treats :name as a bind parameter, so you'd have to

[sqlalchemy] Re: complex query failing because of postgres type annotations.

2008-09-08 Thread Diez B. Roggisch
Michael Bayer schrieb: On Sep 8, 2008, at 3:27 PM, Diez B. Roggisch wrote: But it fails with raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect) OperationalError: (OperationalError) unrecognized token: : ... text() treats :name as a bind

[sqlalchemy] Re: complex query failing because of postgres type annotations.

2008-09-08 Thread Michael Bayer
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(rcount(*)\:\:float)], and_(at.c.question_id == qt.c.id)).as_scalar() can't

[sqlalchemy] Re: complex query failing because of postgres type annotations.

2008-09-08 Thread Diez B. Roggisch
Michael Bayer schrieb: 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(rcount(*)\:\:float)], and_(at.c.question_id ==

[sqlalchemy] Re: complex query failing because of postgres type annotations.

2008-09-08 Thread Michael Bayer
On Sep 8, 2008, at 5:12 PM, Diez B. Roggisch wrote: Michael Bayer schrieb: 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(rcount(*)\:\:float)],

[sqlalchemy] Re: complex query failing because of postgres type annotations.

2008-09-08 Thread Diez B. Roggisch
yeah (select(x).as_scalar() / select(y).as_scalar).label('mylabel') Ah. Good. I did look for alias, and obviously found the wrong thing. Thanks, Diez --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups