Getting nice PostgreSQL pgAdmin-style DDL
Digging around in the pgAdmin source code it appears that the routines to generate the DDL are embedded within the application code. For instance, I the code to generate the table DDL can be found in pgTable::GetSql.