Does anyone know how to change a column in SQLite and PostgreSQL to LONGTEXT?
I have done so in MySQL successfully with:
“ALTER TABLE projects MODIFY description LONGTEXT;”
But this clause doesn’t seem to work on SQLite. I tried hard to find documentation on PostgreSQL, but that site’s format really makes people puke. SQLite’s website is better but the only command I find relevant, alter table, doesn’t seem to support changing column data type at all. ( infact, it doesn’t even allow changing column name!!!)
Thanks all!
For PostgreSQL, see the doc here (e.g.,
ALTER TABLE my_table ALTER COLUMN my_col text).The SQLite doc states
And I suppose changing the datatype of the column is out of scope. Probably to support this, you will need to do a
SELECT * INTO ...followed byDROP TABLE ...and then create the table and runINSERT INTO ... SELECT * FROM ...