PostgreSQL module not working for Snow Leopard Fix
If you have recently upgraded your Mac to the 64bit OS Snow Leopard you may be getting this message when importing the pgdb python module:
ImportError: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/_pg.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)
To fix you can recompile the pg.so library in 64bit or you can set this variable with the following command:
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
NOTE: This setting will revert back to 64bit when you reboot your computer.