[sqlalchemy] Exit Sqlalchemy

2009-07-05 Thread jilong
--~--~-~--~~~---~--~~ 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.

[sqlalchemy] Re: Data types from a calculated column

2009-07-05 Thread Pongetti
For some reason if I use CAST directly in PG, it complains "cannot change data type of view column". Its rather cumbersome but it does seem to at least work in SQLAlchemy. Thanks. On Jul 5, 3:43 pm, Michael Bayer wrote: > any expression in SQL can be coerced into a particular type using > cas

[sqlalchemy] Re: Data types from a calculated column

2009-07-05 Thread Michael Bayer
any expression in SQL can be coerced into a particular type using casts. PG supports the SQL standard CAST operator which SQLAlchemy provides as expression.cast, i.e. from sqlalchemy import cast, Integer cast(somevalue + someothervalue, Integer) This will instruct PG to cast the value as inte

[sqlalchemy] Data types from a calculated column

2009-07-05 Thread Pongetti
Hello, I have a View in a Postgres DB with some calculated columns. In Postgres the column types are getting "lost", so essentially, despite all the math being on integers, Postgres is spitting out columns with the type Numeric instead of type Integer. Using SQLAlchemy, I am therefore getting v