My computer broke down but fortunately I backed up
the folder C:\Program Files\PostgreSQL.
Now I'm working in a new computer and I would like to import the previous
Postgres databases that are stored in the external disk.
I would like to export the schema of a specific database
that is located in the backup folder.
The file PostgreSQL\8.3\data\global\pg_database
contains information
about databases and their OIDs; for example:
"db1" 20012
"db2" 23456
I would like to export the schema of "db1".
There is a folder named "20012" in folder "PostgreSQL\8.3\data\base\20012"
that contains a lot of files [500 files].
Is there any way to export the schema of that database?
Note that all of the Postgresql database files are located
in an external hard disk and I would like to export the schema of that database in an SQL file, take that file, run it and create the same exact database locally.
Copyright Notice:Content Author:「programmer」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/14486241/how-can-i-export-the-schema-of-a-database-in-postgresql