40

In a similar vein to this question, how would I do a schema-only dump in PostgreSQL?

warren
  • 19,297

2 Answers2

66

pg_dump --schema-only

jldugger
  • 14,602
21

If you only want the CREATE TABLE statements, then you can do pg_dump -s databasename | awk 'RS="";/CREATE TABLE[^;]*;/'

arod
  • 632