I happened to do some moderating stuff with large database but I am not so experienced in it so i guess the smart thing is to create similar database on my localhost to not mess up with original one.
And here is my question, is it possible to generete SQL script which will create exact table as i want?
I mean on MySQL GUI tool there is option like this, reverse engineering which generate SQL script which will create exact database as I used function on, is it possible in PostgreSQL in shell level?
Add a comment
|
1 Answer
pg_dump --schema-only db1 > db-schema.sql
2 Comments
Grzzzzzzzzzzzzz
does it not takes records saved with it? Is it possible to use it somehow only on tables with out records? edit: ahh ok
--schema-only i get it. Thank you Richard.Richard Huxton
That is what --schema-only does. Read the manual for full details postgresql.org/docs/current/static/app-pgdump.html