On my Slackware Linux I installed sgml-tools package first, then followed http://developer.postgresql.org/pgdocs/postgres/docguide-toolsets.html with one correction:
export D2MDIR=/usr/bin
After that building of documentation went smoothly :)
Notes:
If you got error message
(Fatal format file error; I'm stymied)
when installing jadetex ( jadetex-3.13), then you need to do:
ln -s pdfetex pdfjadetex ln -s pdfetex jadetex
instead of installation instruction.