{"id":20491650,"url":"https://github.com/dalibo/pg_restore_points","last_synced_at":"2026-03-08T02:02:13.440Z","repository":{"id":259463949,"uuid":"877948478","full_name":"dalibo/pg_restore_points","owner":"dalibo","description":"restore_points is a PostgreSQL extension that allows managing restore points in a PostgreSQL instance. It creates a schema, table, sequence, and function to facilitate the management and tracking of restore points.","archived":false,"fork":false,"pushed_at":"2024-12-04T09:43:13.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-02-12T01:30:28.242Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dalibo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-24T14:13:36.000Z","updated_at":"2024-12-04T09:43:16.000Z","dependencies_parsed_at":"2024-10-25T18:13:01.820Z","dependency_job_id":"0e6a558f-c1d6-494c-9cad-6f0392de21a0","html_url":"https://github.com/dalibo/pg_restore_points","commit_stats":null,"previous_names":["dalibo/restore_points"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dalibo/pg_restore_points","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalibo%2Fpg_restore_points","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalibo%2Fpg_restore_points/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalibo%2Fpg_restore_points/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalibo%2Fpg_restore_points/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dalibo","download_url":"https://codeload.github.com/dalibo/pg_restore_points/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalibo%2Fpg_restore_points/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30242403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T17:25:22.919Z","updated_at":"2026-03-08T02:02:13.424Z","avatar_url":"https://github.com/dalibo.png","language":"PLpgSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pg_restore_points\n\n## Description\n\n`pg_restore_points` is a PostgreSQL extension that allows managing restore points in a PostgreSQL instance. It creates a schema, table, sequence, and function to facilitate the management and tracking of restore points.\n\n### Features\n\n- **Restore Point Management**: Creates and logs restore points in a dedicated table.\n- **PL/pgSQL Function**: The `pg_extend_create_restore_point` function creates a restore point using `pg_create_restore_point()` and logs the information in the `restore_points` table. It supports different validation modes.\n- **Creation Modes**:\n  - `NOSTRICT`: Creates the restore point without any prior validation.\n  - `STRICT`: Ensures that the combination of `restore_point_name` and `walfile` does not already exist.\n  - `USTRICT`: Ensures only that the restore point name does not already exist.\n- **WAL File Tracking**: Associates each restore point with the corresponding WAL file using `pg_walfile_name()`.\n\n### Installation\n\n#### From source\n\n1. Compile and install the extension with `make`:\n\n   ```bash\n   make install\n   ```\n\n2. In PostgreSQL, create the extension:\n\n   ```sql\n   CREATE EXTENSION pg_restore_points;\n   ```\n\n#### From package\n\n##### Debian\n\n```bash\nexport PGRESTOREPOINTSVERSION=\"1.0.0\"\nexport PGVERSION=17\nwget https://github.com/dalibo/pg_restore_points/releases/download/v${PGRESTOREPOINTSVERSION}/pg_restore_points_${PGVERSION}_${PGRESTOREPOINTSVERSION}_amd64.deb\ndpkg -i pg_restore_points_${PGVERSION}_${PGRESTOREPOINTSVERSION}_amd64.deb\n```\n\n##### RedHat\n\n```bash\nexport PGRESTOREPOINTSVERSION=\"1.0.0\"\nexport PGVERSION=17\nwget https://github.com/dalibo/pg_restore_points/releases/download/v${PGRESTOREPOINTSVERSION}/pg_restore_points_${PGVERSION}-${PGRESTOREPOINTSVERSION}-1.x86_64.rpm\nrpm -i pg_restore_points_${PGVERSION}-${PGRESTOREPOINTSVERSION}-1.x86_64.rpm\n```\n### Usage\n\n```sql\n-- Create a restore point (by default with NOSTRICT mode)\nSELECT pg_extend_create_restore_point('backup_2024_10_22');\n\n-- Create a restore point with STRICT mode\nSELECT pg_extend_create_restore_point('backup_2024_10_22', 'STRICT');\n\n-- View existing restore points\nSELECT * FROM restore_points;\n```\n\n### `restore_points` Table Structure\n\n- **id**: Unique identifier of the restore point.\n- **restore_point_name**: Name of the restore point.\n- **point_time**: Date and time of the restore point creation.\n- **lsn**: Log Sequence Number associated with the restore point.\n- **walfile**: WAL file corresponding to the LSN.\n\n### Restore Point Purging Function\n\nThe `pg_restore_points` extension also provides a function to purge restore points older than a specified time interval.\n\n#### Function `pg_purge_restore_points`\n\nThe `purge_restore_points(interval_param INTERVAL)` function allows deleting restore points based on a specified interval. This is useful for managing old restore points and avoiding the accumulation of unnecessary data.\n\n#### Syntax\n\n```sql\nSELECT pg_purge_restore_points('interval_value');\n```\n\n- **interval_value**: The time interval (e.g., `'1 month'`, `'2 days'`, `'6 hours'`, etc.) for which restore points older than this value will be deleted.\n\n#### Usage\n\n```sql\n-- Deletes all restore points older than one month\nSELECT pg_purge_restore_points('1 month');\n```\n\n#### Technical Details:\n- The function uses the `point_time` column of the `restore_points` table to determine which records to delete.\n- A `NOTICE` message is returned indicating that the purge was successful.\n\n### Authors\n\nExtension developed by Dalibo, 2024.\n\n**Contributors**\n\n- [Robin Portigliatti](https://www.linkedin.com/in/robin-portigliatti-464838a7/) ;\n- [Alexandre Pereira](https://www.linkedin.com/in/alexpereira-5/) ;\n- [Guillaume Armede](https://www.linkedin.com/in/guillaume-armede-811304147/) ;\n- [Guillaume Lelarge](https://github.com/gleu) ;\n- [Franck Boudehen](https://www.linkedin.com/in/franck-boudehen-35754b65).\n\n\n### Instructions\n\n1. Download this repository.\n2. Then run `make install`:\n\n   ```bash\n   make install\n   ```\n\n3. Then run `make installcheck`:\n\n   ```bash\n   make installcheck\n   ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalibo%2Fpg_restore_points","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdalibo%2Fpg_restore_points","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalibo%2Fpg_restore_points/lists"}