Skip to content

db-utils

Recursive JSONB updates, column comments and timestamp setup helpers.

db-utils · Recursive JSONB updates, column comments and timestamp setup helpers.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
102163db-utilsdb-utils0.47.0FUNCMITPLpgSQL

Usage

Sources:

db-utils provides recursive JSONB utilities in a fixed schema. db_utils.jsonb_deep_merge recursively merges objects with the patch winning other conflicts, while db_utils.jsonb_set_deep creates intermediate objects when setting a nested path.

Core Workflow

CREATE EXTENSION "db-utils";
SELECT db_utils.jsonb_deep_merge('{"a":{"x":1}}', '{"a":{"y":2}}');
SELECT db_utils.jsonb_set_deep('{}', ARRAY['a','b'], '3'::jsonb);

Operational Boundaries

db_utils.get_column_smart_comment reads a column comment and runs as SECURITY DEFINER. db_utils.timestamps alters the named table: it adds missing timestamp columns, replaces its timestamp trigger and creates missing indexes. That helper requires DDL privileges and takes the normal DDL locks; it is not a read-only timestamp function. Dependencies are inflection-db, pgpm-inflection, pgpm-stamps, pgpm-verify, plpgsql. This SQL-only module needs no library preload or restart; no PostgreSQL-major support matrix is published for this revision. Its fixed schema layout is not relocatable. Install the matching dependency closure before enabling it.

Table reader