27

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..

DMS
  • 808
  • 2
  • 20
  • 34

2 Answers2

53

pg_dump is a command line utility; it isn't SQL, so it won't work in pgAdmin or anywhere else that executes SQL.

pgAdmin 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
Bohemian
  • 412,405
  • 93
  • 575
  • 722
2

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 for more details.

Anvesh
  • 7,103
  • 3
  • 45
  • 43