Postgresql Equivalent of MySQL SHOW CREATE xxx
You cannot do it in SQL, but you can use the pg_dump executable to get the complete table definition:

pg_dump --schema-only --table=tablename databasename


This won't work for databases, however.