Ptrack is a fast block-level incremental backup engine for PostgreSQL. Currently ptrack
codebase is split approximately 50%/50% between PostgreSQL core and extension. All public SQL API methods are placed in the ptrack
extension, while the main engine is still in core.
- Get latest PostgreSQL sources:
git clone https://.com/postgres/postgres.git -b REL_12_STABLE && cd postgres
- Apply PostgreSQL core :
git apply ptrack/es/ptrack-2.0-core.diff
Compile and install PostgreSQL
Set
ptrack_map_size
(in MB)
echo 'ptrack_map_size = 64' >> postgres_data/postgresql.conf
- Compile and install
ptrack
extension
USE_PGXS=1 make -C /path/to/ptrack/ install
- Run PostgreSQL and create
ptrack
extension
CREATE EXTENSION ptrack;
- ptrack_version() --- returns ptrack version string (2.0 currently).
- pg_ptrack_get_pagemapset('LSN') --- returns a set of changed data files with bitmaps of changed blocks since specified LSN.
- pg_ptrack_control_lsn() --- returns LSN of the last ptrack map initialization.
- pg_ptrack_get_block --- returns a requested block of relation.
TBA
The main goal currently is to move as much ptrack
functionality into the extension as possible and leave only certain requred hooks as core .