How to export a Postgresql db into SQL that can be executed into other pgAdmin?
1.Set PGPASSWORD
export PGPASSWORD='123123123';
2.Export DB with pg_dump
pg_dump -h <> -U <> <> > /opt/db.out
/opt/db.out is dump path. You can specify of your own.
3.Then set again PGPASSWORD of you another host. If host is same or password is same then this is not required.
4.Import db at your another host
psql -h <> -U <> -d <> -f /opt/db.out
If username is different then find and replace with your local username in db.out file. And make sure on username is replaced and not data.
If you still want to use PGAdmin then see procedure below.
Select DB and click Export.
Use Insert CommandsMenu->Plugins->PSQL ConsoleType following command to import DB
\i /path/to/db.sql
If you want to export Schema and Data separately.
Export Schema
Only SchemaBlobs (By default checked) Export Data
Only DataBlobs (By default checked) Use Insert CommandsVerbose messages (By default checked)Note: It takes time to Export/Import based on DB size and with PGAdmin it will add some more time.