pg_extractor | PG Extractor - Advanced PostgreSQL Dump Filter
kandi X-RAY | pg_extractor Summary
kandi X-RAY | pg_extractor Summary
pgextractor is both a command line script and python class that can be used to provide more finely detailed filtering options for postgresql's pg_dump program. each database object is extracted into its own file organized into folders by type. this makes having the database schema as a reference easier and allows for better checking into version control. by default data is not dumped, but is easily done with a single option and can be done as plaintext or pg_dump's custom format. object filtering can be done directly via command line options or fed in with external text files. regex pattern matching is also possible. see --help & --examples for a full list of available options and how to use the script. the script only uses pg_dump/all to touch the database. pg_restore
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create extract files from a list of objects
- Print a list of values
- Recursively replace all functions and views
- Run pg_dump command
- Runs a pg_restore command
- Filter the main object list
- Build a filter list
- Create argument parser
- Set configuration
- Create a temporary dump file
- Prints values to stdout
- Print the minimum usage
- Recursively replace a list of functions
- Checks the version of the bin
- Delete all files in the specified directory
- Extract roles from database
- Check the version of the bin file
- Removes passwords from a role file
- Cleans up temp files
pg_extractor Key Features
pg_extractor Examples and Code Snippets
Community Discussions
Trending Discussions on pg_extractor
QUESTION
I have inherited an application which is written in dozens (maybe hundreds, I haven't counted exactly) of PostgreSQL functions. In order to check the application code into git and be able to easily work on specific functions, I used pg_extractor to export the database into a separate file for each function.
In order to easily apply updates from git (both on developer machines and in production), I wrote a bash script that uses the psql
command line client to run all of the function files, which causes the database server to be updated to match the files from git.
The gist of it looks like this (with some initialization code replaced by comments for brevity):
...ANSWER
Answered 2019-Jul-25 at 04:32Running the connection through PgBouncer
instead of directly to Postgres makes a huge difference.
Using it, my script run on Windows is reduced to around 30 seconds.
It's still not quite as fast as on Linux, but I can live with "only" a 6x improvement.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pg_extractor
You can use pg_extractor like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page