Skip to content

table_guard

Configurable protection against DROP, TRUNCATE, and unqualified whole-table DELETE.

pg_table_guard · Configurable protection against DROP, TRUNCATE, and unqualified whole-table DELETE.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101960table_guardpg_table_guard1.0SECC

PostgreSQL · 14, 15, 16, 17, 18

Usage

Sources:

table_guard Configurable protection against DROP, TRUNCATE, and unqualified whole-table DELETE.

Enablement

Merge table_guard into the existing preload list, restart PostgreSQL, and then create table_guard in each database that needs its SQL objects:

shared_preload_libraries = 'table_guard'
CREATE EXTENSION table_guard;

Core Workflow

The following example is taken from the reviewed upstream documentation. Adapt object names, paths, credentials, and workload values before use.

SELECT * FROM table_guard_settings;

Main Objects

The reviewed install surface includes these prominent objects:

ObjectKindOperational role
table_guard_helpFUNCTIONCallable function from the reviewed install surface.
table_guard_settingsVIEWInspection or query view created by the extension.
table_guard_versionFUNCTIONCallable function from the reviewed install surface.

Operations and Boundaries

  • The verified PostgreSQL-major evidence covers 14, 15, 16, 17, 18; do not infer unlisted majors.
  • Preloading table_guard changes cluster startup state; stage configuration and restart changes separately from CREATE EXTENSION.

Table reader