You may still miss some DDL...

The log_statement = 'ddl' statement will log only DDL statements explicitly given in top-level commands. It is still possible to perform DDL without it being logged by this setting if you use any of the PL languages, either through DO statements or by calling a function that includes DDL statements.

Starting from version 9.3, it is possible to capture and log DDL statements through the event triggers mechanism. The basic idea is as follows. We define a special event trigger function, to be executed once after each DDL. The function will receive a string that describes the command tag (CREATE TABLE, ALTER VIEW, and so on) from PostgreSQL, and will log the desired information using the PostgreSQL logging infrastructure ...

Get PostgreSQL Administration Cookbook, 9.5/9.6 Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.