Change typedef static assertion to C++11 static_assert
Allow postgres to be an optional dependency