
Hello, I would like to know if it is possible to change a column type. I have a table with millions of records and I wand to change the type of the column (id) but I couldn't find how to do that. Thanks in advance for your help, Regards,Baraa

Hi, given that MonetDB is a column store, an explicit column copy should be sufficient (provided a different column name is acceptable; AFAIK, there is no support to rename a column): alter table <tab> add column <new_col> <typ>; update <tab> set <new_col> = cast(<old_col> as <typ>); (alter table <tab> drop column <old_col>;) Stefan ----- Original Message -----
-- | Stefan.Manegold@CWI.nl | DB Architectures (DA) | | www.CWI.nl/~manegold/ | Science Park 123 (L321) | | +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
participants (3)
-
baraa Mohamad
-
Martin Kersten
-
Stefan Manegold