pg_surgery
extension to perform surgery on a damaged relation
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_surgery | 1.0 | ADMIN | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 5990 | pg_surgery | No | Yes | No | Yes | No | No | - |
| Related | pg_catcheck pg_checksums amcheck pg_orphaned pg_pathcheck pageinspect pg_repack lo lolor pg_isok |
|---|
Version
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
Install
Note: This is a built-in contrib extension of PostgreSQL
Usage
pg_surgery: extension to perform surgery on a damaged relation
The pg_surgery extension provides functions to perform low-level surgery on damaged relations. These are last-resort tools that can corrupt data if misused.
Functions
heap_force_kill
Marks line pointers as “dead” without examining the tuples, forcibly removing inaccessible tuples.
heap_force_freeze
Marks tuples as frozen without examining tuple data, making tuples accessible when visibility information is corrupted.
When to Use
heap_force_kill: When tuples cause errors on access due to corrupted transaction status, and the data can be discardedheap_force_freeze: When VACUUM fails due to tuples with xmin before relfrozenxid, or when tuples are invisible due to corrupted visibility information
These functions are unsafe by design and should only be used as a last resort when normal recovery methods have failed.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)