March 6th, 2013, 08:25 AM
How to change datatype of a column with large number of data?
I have one column which has 600000 records with char varying datatype and i want to change it to numeric type. We are successful for first 80000 records but do not change for all the 600000 records. We have used php script and stored procedure for that but do not able to do it. So there is any other way using ssh or command line for it.
March 6th, 2013, 09:10 AM
You can't change the data type for just some rows. The datatype is an attribute of the column and thus applies to all rows equally.
And "but do not able to do it." is not a valid Postgres error message. You need to be way more specific why your ALTER TABLE does not work
I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.
Tips on how to ask better questions: