SELECT show_create_table('table_name', 'schema_name'); or SELECT show_create_table('table_name', null);
see http://sourceforge.jp/projects/pgshowcreatetbl/wiki/