On Feb 3, 2010, at 09:58 , Igor Tandetnik wrote:

> Brian Palmer <br...@mozy.com> wrote:
>> Hey all, we've painted ourselves into a bit of a corner and we're
>> trying to find the best way out. Through an oversight during initial
>> development, we defined a column as not null in our schema and we
>> need to drop that not null constraint.   
>> 
>> Since sqlite3 doesn't support altering columns, I know the typical
>> way this is done is to create a new table and copy the data. However,
>> we have hundreds of thousands of sqlite databases on our servers
>> using this schema with large data sets, and it'd be a super expensive
>> operation to do. Logically, dropping a not null constraint shouldn't
>> be expensive at all, it's just a limitation of the current sqlite3
>> language. So we're looking for alternatives.
> 
> There is an undocumented pragma
> 
> pragma writable_schema=ON
> 
> http://www.mail-archive.com/sqlite-users@sqlite.org/msg26998.html
> 

This is perfect! Thanks Igor.

-- Brian Palmer

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to