Muffinresearch Labs by Stuart Colville

Sqlite: ALTER TABLE ADD COLUMN fail on OSX 10.4 | 1 Comment

Posted in Code on 5th February 2008, 11:03 pm by

I’ve been playing with some stuff in Django recently and having updated a model I wanted to add a column to the sqlite database. Unfortunately ALTER TABLE ADD COLUMN statements don’t work in sqlite3.1.3 which is the version installed in Tiger and all you’ll get is a SQL error message.

sqlite> ALTER TABLE snippets_snippet ADD COLUMN 'code' text;
SQL error: near "ADD": syntax error

So how to fix this? Good news fink install sqlite3 will get you version 3.2.8 and you’ll find it in /sw/bin/sqlite3

Post Tools

  • Fábio

    well, it is a very long time since you post your question … but I guess the error is because the ‘ signal after the COLUMN instruction … I think the correct form is:

    ALTER TABLE snippets_snippet ADD COLUMN code text;

GNU screen: open tab in current working directory|(1)

A nice trick for having screen open a new tab in the same directory as the one you’re currently in. To use it add it to your .screenrc

# Open new window in current dir.
bind c stuff "screen -X chdir \$PWD;screen^M"
bind ^c stuff "screen -X chdir \$PWD;screen^M"

Hat tip: mteckert on SuperUser.com

Ubuntu: add-apt-repository: command not found|(3)

When you’re using a minimal Ubuntu install if you find the ‘add-apt-repository’ command is missing (it’s useful for adding PPAs and other repositories), then simply run:

sudo apt-get install python-software-properties

Photos on Flickr

© Copyright 2004-12 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.550s.