Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
In a similar vein to this question, how would I do a schema-only dump in PostgreSQL?
If you only want the CREATE TABLE statements, then you can do pg_dump -s databasename | awk 'RS="";/CREATE TABLE[^;]*;/'
pg_dump -s databasename | awk 'RS="";/CREATE TABLE[^;]*;/'
Required, but never shown