pg_catcheck
pg_catcheck
pg_catcheck : Diagnosing system catalog corruption
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 5160 | pg_catcheck
|
pg_catcheck
|
1.6.0 |
ADMIN
|
BSD 3-Clause
|
C
|
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-d--
|
No
|
Yes
|
No
|
Yes
|
no
|
no
|
| Relationships | |
|---|---|
| See Also | pg_checksums
amcheck
pg_surgery
pageinspect
pg_visibility
pgstattuple
ddlx
pgdd
|
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PGDG
|
1.6.0 |
18
17
16
15
14
|
pg_catcheck |
- |
| RPM | PGDG
|
1.6.0 |
18
17
16
15
14
|
pg_catcheck_$v |
- |
| DEB | PGDG
|
1.6.0 |
18
17
16
15
14
|
postgresql-$v-pg-catcheck |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
el8.aarch64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
el9.x86_64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
el9.aarch64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
el10.x86_64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
el10.aarch64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
d12.x86_64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
d12.aarch64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
d13.x86_64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
d13.aarch64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
u22.x86_64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
u22.aarch64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
u24.x86_64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
u24.aarch64
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
PGDG 1.6.0
|
Source
Install
Make sure PGDG repo available:
pig repo add pgdg -u # add pgdg repo and update cacheInstall this extension with pig:
pig install pg_catcheck; # install via package name, for the active PG version
pig install pg_catcheck -v 18; # install for PG 18
pig install pg_catcheck -v 17; # install for PG 17
pig install pg_catcheck -v 16; # install for PG 16
pig install pg_catcheck -v 15; # install for PG 15
pig install pg_catcheck -v 14; # install for PG 14Create this extension with:
CREATE EXTENSION pg_catcheck;Usage
pg_catcheck is a command-line tool that checks PostgreSQL system catalogs for corruption by verifying cross-references between catalog tables. It accepts the same connection parameters as other PostgreSQL utilities (-h, -p, -U, -d).
Basic Usage
pg_catcheck -h localhost -p 5432 -d mydbNormal output when no issues are found:
progress: done (0 inconsistencies, 0 warnings, 0 errors)Example Output with Corruption
notice: pg_class row has invalid relnamespace "24580": no matching entry in pg_namespace
row identity: oid="24581" relname="foo" relkind="r"
notice: pg_type row has invalid typnamespace "24580": no matching entry in pg_namespace
row identity: oid="24583"
progress: done (4 inconsistencies, 0 warnings, 0 errors)Result Categories
- Inconsistencies: logical problems in catalog cross-references (e.g., dangling OID references)
- Warnings: more serious issues
- Errors: inability to read catalogs
Options
pg_catcheck --help # Full list of options
pg_catcheck --select-from-relations # Also check for missing/inaccessible relation filesConnection
Supports the same options as psql: -h host, -p port, -U user, -d database, or connection strings/URLs.
Last updated on