Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add on-segment mode for pg_dump utility #990

Open
wants to merge 2 commits into
base: adb-6.x-dev
Choose a base branch
from

Conversation

kooooootb
Copy link

Add pg_dump on-segment mode, which makes pg_dump store data locally on segments

In this mode utility uses COPY ... TO PROGRAM ... ON SEGMENT instead of normal COPY and passes output of it to pg_dump utility on each segment.
To restore data it inserts COPY ... FROM PROGRAM ... ON SEGMENT operators into script in resulting dump, which read data from pg_dump utility on each segment.

This mode gets activated by using --on-segment flag, it generates dump on client side as usual and dumps on each used segment, compression level and archive formats are forwarded to segments' utilities and is used in generating resulting archives
Generated on the client dump can be used by pg_restore or psql (for plain texts) as usual

Also to manage data on segments 2 other system modes were added.
First one (--on-segment-internal-dump-mode) reads data from stdin to stores it locally with forwarded archive format and compression level.
Second (--on-segment-internal-restore-mode) reads stored data and passes it to stdout
They should not be friendly for common user

This mode is used to save data on each segment locally part by part
@RekGRpth
Copy link
Member

How about to use synchronized snapshot like gpbackup does?

@kooooootb
Copy link
Author

How about to use synchronized snapshot like gpbackup does?

Hello, pg_dump itself already sets snapshot to operate in using
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ ONLY
statement.
Also it explicitly locks each table with
LOCK TABLE

IN ACCESS SHARE MODE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants