Switch to postgresql
Fix infinite redirect