I'm opening a new bug, cause it seems that my comments in bug 217528 go straight to /dev/null. Current ebuild for x11-libs/qt-sql needs to be fixed for the case when only postgresql package installed is dev-db/libpq. In that case, no libpgport is installed, so qt-sql fails if postgres useflag is set. qt-sql doesn't need libpgport, it's just noise added by `pg_config --libs`. To make it build, only thing that's needed is adding `sed -i -e '/pg_config --libs/d' "${S}"/configure` to src_unpack.
Finally committed, thanks for your patience.