Thursday, October 21, 2010

a couple videos from DjangoCon 2008

Cal Henderson on why he hates Django, covers issues of scaling and how Django may implement better scaling features in the future. Some of these are likely implemented now.

Guido on the Google App Engine:

Sunday, October 3, 2010

upgrading PostgreSQL on Debian/Ubuntu

I've been upgrading pg on a few servers today. One from 8.1 to 8.4 (debian) and the other from 8.2 to 8.4 (ubuntu). In both cases the process worked as noted here (though I used aptitude):
  1. backup your db(s)

  2. add backports repositories ubuntu, debian instructions (don't forget about pinning)
aptitude install postgresql-8.4
pg_dropcluster --stop 8.4 main
pg_upgradecluster 8.1 main

Once you're sure that's working:
pg_dropcluster --stop 8.1 main
apt-get remove postgresql-8.1

Friday, October 1, 2010

mysql string search and replace

UPDATE [tablename] SET [fieldname] = REPLACE([fieldname],"[oldstring]","[newstring]");

The code above would operate on every row in the table but you may want WHERE conditions. Example:
UPDATE profile SET homepage = REPLACE(homepage,"","") WHERE first_name="Joe" AND last_name="Schmoe";

Will change Joe's homepage to instead of