extfs: add pgdump helper for PostgreSQL pg_dump custom-format archives#5129
Open
axon003 wants to merge 1 commit into
Open
extfs: add pgdump helper for PostgreSQL pg_dump custom-format archives#5129axon003 wants to merge 1 commit into
axon003 wants to merge 1 commit into
Conversation
Browse a "pg_dump -Fc" archive as a tree: schemas as folders, objects as .sql files; view/copyout yields a runnable SQL script (CREATE + COPY data + dependent indexes/constraints/triggers). Pure Python, stdlib only (gzip); zstd via the optional "zstandard" module. Handles archive versions 1.12..1.16 (PostgreSQL 9.x..17). Registered in mc.ext.ini by content type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
extfs: pgdump helper for PostgreSQL pg_dump custom-format archives
A read-only extfs helper that lets you browse a
pg_dump -Fcarchive inside mc as a folder tree:.sqlfiles;CREATEstatement, its data as aCOPYblock (terminated with\.), and the dependent indexes / constraints / triggers, so it pastes straight intopsql.Implementation notes:
zlib); Zstandard-compressed archives (PostgreSQL 16+) are read when thezstandardmodule is installed;tableamsince PG12,relkindsince PG17, and the 1.15 one-byte compression-algorithm header);mc.ext.iniby content type (PostgreSQL custom database dump) so it triggers for any file extension.Tested against dumps produced by PostgreSQL 11 and 17 (plain and gzip).