PostgreSQL support restored. Maybe.

VERY UNTESTED OH GOD.