Hi, I wanted this to be done in a single step (web request), due to the nature of my app (dynamic db), but I see it can't.
Thank you all for your replies. Carlos On Friday, April 13, 2012 8:24:29 AM UTC-5, Massimo Di Pierro wrote: > > Since there are no record you do not need conversion of string to > decimals. > You can do it in two steps: > 1) comment the line that defines the field and run appadmin > 2) uncomment the line, change the type and run appadmin > done > > On Thursday, 12 April 2012 15:37:26 UTC-5, Carlos wrote: >> >> Hi, >> >> Is it possible (and how) to change a field type from string to decimal >> without recreating the table?. >> >> There are no records in the table yet, but I would like to know if >> there's a way to accomplish this from web2py (without recreating the >> database). >> >> The error I get: >> >> <class 'psycopg2.ProgrammingError'> column "xfield__tmp" is of type >> numeric but expression is of type character varying LINE 1: UPDATE xtable >> SET xfield__tmp=xfield; ^ HINT: You will need to rewrite or cast the >> expression. >> >> I'm using latest web2py trunk with postgresql. >> >> Thanks, >> >> Carlos >> >>