WIP Patch: pg_dump structured - Mailing list pgsql-hackers

From Attila Soki
Subject WIP Patch: pg_dump structured
Date
Msg-id 58683202-75BA-47A8-A65C-A9F8F796FF06@attilasoki.com
Whole thread Raw
Responses Re: WIP Patch: pg_dump structured  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi all,

I was looking for a way to track actual schema changes after database migrations
in a VCS. Preferably, the schema definition should come from a trusted source
like pg_dump and should consist of small files.
This patch was born out of that need.

This patch adds the structured output format to pg_dump.
This format is a plaintext output split up into multiple files and the
resulting small files are stored in a directory path based on the dumped object.
This format can be restored by feeding its plaintext toc file (restore-dump.sql)
to psql. The output is also suitable for manipulating the files with standard
editing tools.

This patch is a WIP (V1). The patch is against master and it compiles
successfully on macOS 13.2.1 aarch64 and on Debian 11 arm64.
To test, execute pg_dump --format=structured --file=/path/to/outputdir dbname

What do you think of this feature, any chance it will be added to pg_dump once
the patch is ready?
Is the chosen name "structured" appropriate?

Thanks for any feedback.

--
Attila Soki


Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Progress report of CREATE INDEX for nested partitioned tables
Next
From: Tom Lane
Date:
Subject: Re: WIP Patch: pg_dump structured