1

I've created a database in pgAdmin, in which I've 1 public schema and 4 custom schema's. These schema contains several functions, sequences and Tables. Now I want to export a script that can create same database with the same structure without any data. Please help me with this....

2

2 Answers 2

0

You are looking for pg_dump with the (default) plain format.

Sign up to request clarification or add additional context in comments.

Comments

0

If you can access to the command line, type this

pg_dump --create --clean --schema-only -U your_user -d db_name > file_name.sql

Then in the server you need to create same database run this

psql -U db_user -d db_name < file_name.sql

--clean option tries to drop all objects before creating them.

--create Begin the output with a command to create the database itself and reconnect to the created database.

Comments

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.