I'm thinking something like SELECT * FROM pg_creation_commands({'pg_class'::regclass, 'sometable'::pg_class}); would return a set of commands in the JSON-blob format that creates the table. The input argument is an array of object addresses, so that you can request creation commands for multiple objects. (It's not my intention to provide this functionality right away, but if somebody else wants to work on top of the current deparse patch, by my guest; if it proves simple enough we can still get it into 9.5 as part of this patch.)
+1
Another possible function could be to diff two relations to produce a set of DDL commands that could be used for schema migrations.
Also thank you very much! CREATE/ALTER support in event triggers is the upcoming feature I am most excited about, and I am happy to see progress.