https://github.com/onurdemirtas/postgresql.schema.parse
First, it exports schema file from PostgreSQL with "pg_dump --schema-only". Then, parses the schema file for separating the each object types into separate folders and each object into a separate file.
https://github.com/onurdemirtas/postgresql.schema.parse
backup bash bash-script compare linux meld parser postgresql postgresql-database schema ubuntu
Last synced: 2 months ago
JSON representation
First, it exports schema file from PostgreSQL with "pg_dump --schema-only". Then, parses the schema file for separating the each object types into separate folders and each object into a separate file.
- Host: GitHub
- URL: https://github.com/onurdemirtas/postgresql.schema.parse
- Owner: onurdemirtas
- Created: 2024-12-14T12:25:12.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-12-15T10:16:02.000Z (4 months ago)
- Last Synced: 2024-12-26T01:14:00.147Z (4 months ago)
- Topics: backup, bash, bash-script, compare, linux, meld, parser, postgresql, postgresql-database, schema, ubuntu
- Language: Shell
- Homepage:
- Size: 236 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# postgresql.schema.parse
First, it exports schema file from PostgreSQL with "pg_dump --schema-only". Then, parses the schema file for separating the each object types into separate folders and each object into a separate file. You can also parse a previously extracted pg_dump file with this script by making minor changes.The code consists of 3 parts.
1. Extracting the schema file with PostgreSQL / pg_dump
2. Parsing objects to folders and files with the Bash script
3. Archiving all files and converting them into a single fileYou can change any of these parts or use any you want.
Detailed Steps;
1. Download postgresql.schema.parse.sh file to any folder of you

2. Edit database configuration part in the top of the file

3. Open a terminal window from the folder
4. Run "bash postgresql.schema.parse.sh"

5. You will find a dated tar.gz archive file on the same folder

6. You can keep this archive file regularly for schema backup
7. Extract this archive to a folder for examine any file in it

8. You can compare local and prod schema folders with "Meld" folder compare feature
