1

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?

1 Answer 1

3
pg_dump --schema-only db1 > db-schema.sql
Sign up to request clarification or add additional context in comments.

2 Comments

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.
That is what --schema-only does. Read the manual for full details postgresql.org/docs/current/static/app-pgdump.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.