Is there any way to generate DDL in postgresql other than pg_dump.exe? Preferrably with a sql call to the server.

There are a couple views in INFORMATION_SCHEMA that have DDL for a few object types, but they are far from complete. usually the DDL there isn't complete anyway (like in the ROUTINES view, the CREATE FUNCTION preamble is always missing).

I am working on v8.2