Site migration

Nov. 9, 2011, 9:33 p.m.

I decided to move to web hosting on a VPS instead of shared hosting. Having root on the box gives me some latitude for some projects I plan on working on. After switching to a development role, I sort of missed server administration as well.

If you have a Django site running on MySQL and decide to convert to Postgresql you are in for some fun. The most notable problem is that your boolean fields will actually be boolean in Postgresql instead of being a smallint value of 0 or 1 as they were in MySQL.

ALTER TABLE your_table_name ALTER COLUMN "your_column" TYPE boolean
USING (case when "your_column" = 1 then true else false end);

If you have a default value for these fields you will need to remove them before this transaction and set them up again afterward.

tags( #django #python )


Various Coding and Scripting Endeavors


Whats going on generally.

Neat Stuff

Things I have found useful or interesting on the internet, for what it is worth.

Follow caller9com on Twitter