I've got postgresql 7.2 on my system, which the qt ebuild doesn't seem to like (it wants to install 7.1.3), so before emerging qt I did an: export USE="-postgres" emerge --pretend qt showed that postgresql-7.1.3 had disappeared from the dependency list, but when I did the proper emerge, flags relevant to postgresql support (-I/usr/include/postgresql for example) were on the g++ command-line, and the build failed when trying to build the QT postgresql driver.
Upgrade to portage 1.9.9; this should be fixed.