Question: I want sql script of postgres 9 database schema which is not on local server. I tried pg\_dump command on sql editor of pgAdmin and its not working there. I m not sure where to run that command. Please assist me with the same....
Thanks..

Answer: 
[`pg_dump`](http://www.postgresql.org/docs/8.4/static/app-pgdump.html) is a command line utility; it isn't SQL, so it won't work in pgAdmin or anywhere else that executes SQL.

[`pgAdmin`](http://www.pgadmin.org/) however does have a facility to do what you want:

1. Right-click on the database you want to export
2. Select `Backup` from the pop-up menu
3. Chose "format" `Plain`
4. Chose "plain option" `Only schema`
You can also use pgAdmin tool to generate or take plain text Database Backup. 
You can generate plain text backup for data or schema only. 

I have shared few screen shots, please visit **[this blog](http://www.dbrnd.com/2016/09/postgresql-generate-full-database-script-using-pgadmin-tool-schema-data-script-plain-text-backup-option/)** for more details.