Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 2 down vote accepted
pg_dump --schema-only db1 > db-schema.sql
share|improve this answer
    
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. –  Grzzzzzzzzzzzzz Feb 1 '13 at 8:49
1  
That is what --schema-only does. Read the manual for full details postgresql.org/docs/current/static/app-pgdump.html –  Richard Huxton Feb 1 '13 at 8:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.