How can I do a dump of only the table structure in PostgreSQL?
Solution 1:
pg_dump --schema-only
Solution 2:
If you only want the CREATE TABLE
statements, then you can do pg_dump -s databasename | awk 'RS="";/CREATE TABLE[^;]*;/'
pg_dump --schema-only
If you only want the CREATE TABLE
statements, then you can do pg_dump -s databasename | awk 'RS="";/CREATE TABLE[^;]*;/'