logo
I'm the lead developer at The Onion. When I'm not working I enjoy long moonlit walks along the beach with robots, the history of science and technology, and warm fuzzy kittens.

contact me

A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. —Robert A. Heinlein

MySQL To PostgreSQL For Django

Mon Nov 17 6:45 pm, 2008

-
The idea was that you'd use MySQL for speed, PostgreSQL for features, although with PostgreSQL 8 that seems to have changed, and MySQL has caught up a little on features. But with day to day use, I gotta say, I prefer PostgreSQL. Not that I don't love unexpected MySQL table locks. Anyway, didn't your mother ever tell you not to walk into the middle of a database fight? The point is I'm converting part of an app to Django and the previous was stored in MySQL. I could of course write something that iterates over the data and puts it in place in a new postgres home. But that's time consuming. So, take the the MySQL dump, convert it to something postgres understands, once there use Django's inspectdb helper to generate the basics for the model, then work on whatever scrubbing and altering need to be done, cuz that's so much easier once you've got Django on hand to work on the data.