Skip to content

extfs: add pgdump helper for PostgreSQL pg_dump custom-format archives#5129

Open
axon003 wants to merge 1 commit into
MidnightCommander:masterfrom
axon003:add-pgdump-extfs
Open

extfs: add pgdump helper for PostgreSQL pg_dump custom-format archives#5129
axon003 wants to merge 1 commit into
MidnightCommander:masterfrom
axon003:add-pgdump-extfs

Conversation

@axon003

@axon003 axon003 commented Jun 17, 2026

Copy link
Copy Markdown

extfs: pgdump helper for PostgreSQL pg_dump custom-format archives

A read-only extfs helper that lets you browse a pg_dump -Fc archive inside mc as a folder tree:

  • schemas become folders, database objects (tables, views, sequences, functions, types, indexes, triggers, ...) become .sql files;
  • viewing or copying out an object yields a runnable SQL script: its CREATE statement, its data as a COPY block (terminated with \.), and the dependent indexes / constraints / triggers, so it pastes straight into psql.

Implementation notes:

  • pure Python, standard library only (gzip via zlib); Zstandard-compressed archives (PostgreSQL 16+) are read when the zstandard module is installed;
  • parses custom-format archive versions 1.12 .. 1.16 (PostgreSQL 9.x .. 17), including the version-gated TOC fields (tableam since PG12, relkind since PG17, and the 1.15 one-byte compression-algorithm header);
  • registered in mc.ext.ini by 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).

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.
@github-actions github-actions Bot added needs triage Needs triage by maintainers prio: medium Has the potential to affect progress labels Jun 17, 2026
@github-actions github-actions Bot added this to the Future Releases milestone Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs triage Needs triage by maintainers prio: medium Has the potential to affect progress

Development

Successfully merging this pull request may close these issues.

1 participant