pg_fuck_block
pg_get_page_tuple · C extension for reading all tuples from a relation block
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100430 | pg_fuck_block | pg_get_page_tuple | 1.0 | ADMIN | Unknown | C |
Usage
Sources:
- Pinned upstream README
- Pinned version 1.0 installation SQL
- Pinned C implementation
- Pinned extension control file
pg_fuck_block version 1.0 exposes the low-level function pg_get_page_tuple(regclass, bigint) for inspecting tuple slots in one heap block. It is a legacy diagnostic experiment over PostgreSQL storage internals, not a snapshot-consistent table-reading API.
Core Workflow
Because the function returns anonymous record, supply a column definition list matching the target relation when decomposing its output:
The second argument is a zero-based heap block number. A block outside the current relation size raises block number out of range.
Important Objects
pg_get_page_tuple(regclass, bigint) RETURNS SETOF record: scans normal line pointers in a heap page and returns tuples that the implementation does not classify asHEAPTUPLE_DEAD.
Operational Notes
The function does not enforce table SELECT privileges in its C code, yet extension functions are executable by PUBLIC by default. Revoke execution from untrusted roles. Its result is not governed by an ordinary MVCC snapshot: recently dead, in-progress, or otherwise invisible tuples may be exposed, while non-normal line pointers are skipped.
The reviewed 2016 implementation depends on removed or changed backend APIs, releases the relation lock and buffer before multi-call iteration completes, and does not populate the output null bitmap from heap_getattr(). Concurrent modification, rows containing NULL, TOASTed data, or modern PostgreSQL builds can therefore produce incorrect data, memory-safety failures, or backend crashes. Use only on an isolated copy with the exact tested server source; prefer maintained tools such as pageinspect for production diagnostics.