How to get Data from a postgres database and write it to a .doc file?
Checkout this product http://www.sqlmanager.net/products/postgresql/dataexport