Skip to content

supautils

Extension that secures a cluster on a cloud environment

supautils · Extension that secures a cluster on a cloud environment

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
7010supautilssupautils4.0.1SECApache-2.0C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--sL---NoYesYesNonono
Module-only; no CREATE EXTENSION. 4.0 removes constrained-extension functionality and adds global extension scripts and a default extension install schema. Restart preloaded processes after replacing the library.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY4.0.119 18 17 16 15supautils-
RPMPIGSTY4.0.119 18 17 16 15supautils_$v-
DEBPIGSTY4.0.119 18 17 16 15postgresql-$v-supautils-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
el8.aarch64N/APIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
el9.x86_64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
el9.aarch64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
el10.x86_64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
el10.aarch64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
d12.x86_64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
d12.aarch64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
d13.x86_64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
d13.aarch64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
u22.x86_64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
u22.aarch64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
u24.x86_64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
u24.aarch64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
u26.x86_64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
u26.aarch64PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1PIGSTY 4.0.1
PackageVersionOSORGSIZEFile URL
supautils_194.0.1el9.x86_64pigsty100.4 KiBsupautils_19-4.0.1-1PGSTY.el9.x86_64.rpm
supautils_194.0.1el9.aarch64pigsty98.3 KiBsupautils_19-4.0.1-1PGSTY.el9.aarch64.rpm
supautils_194.0.1el10.x86_64pigsty101.7 KiBsupautils_19-4.0.1-1PGSTY.el10.x86_64.rpm
supautils_194.0.1el10.aarch64pigsty99.3 KiBsupautils_19-4.0.1-1PGSTY.el10.aarch64.rpm
postgresql-19-supautils4.0.1d12.x86_64pigsty92.6 KiBpostgresql-19-supautils_4.0.1-1PGSTY~bookworm_amd64.deb
postgresql-19-supautils4.0.1d12.aarch64pigsty90.5 KiBpostgresql-19-supautils_4.0.1-1PGSTY~bookworm_arm64.deb
postgresql-19-supautils4.0.1d13.x86_64pigsty92.8 KiBpostgresql-19-supautils_4.0.1-1PGSTY~trixie_amd64.deb
postgresql-19-supautils4.0.1d13.aarch64pigsty90.8 KiBpostgresql-19-supautils_4.0.1-1PGSTY~trixie_arm64.deb
postgresql-19-supautils4.0.1u22.x86_64pigsty99.9 KiBpostgresql-19-supautils_4.0.1-1PGSTY~jammy_amd64.deb
postgresql-19-supautils4.0.1u22.aarch64pigsty98.0 KiBpostgresql-19-supautils_4.0.1-1PGSTY~jammy_arm64.deb
postgresql-19-supautils4.0.1u24.x86_64pigsty97.0 KiBpostgresql-19-supautils_4.0.1-1PGSTY~noble_amd64.deb
postgresql-19-supautils4.0.1u24.aarch64pigsty95.5 KiBpostgresql-19-supautils_4.0.1-1PGSTY~noble_arm64.deb
postgresql-19-supautils4.0.1u26.x86_64pigsty96.9 KiBpostgresql-19-supautils_4.0.1-1PGSTY~resolute_amd64.deb
postgresql-19-supautils4.0.1u26.aarch64pigsty95.1 KiBpostgresql-19-supautils_4.0.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
supautils_184.0.1el8.x86_64pigsty99.5 KiBsupautils_18-4.0.1-1PGSTY.el8.x86_64.rpm
supautils_184.0.1el8.aarch64pigsty96.8 KiBsupautils_18-4.0.1-1PGSTY.el8.aarch64.rpm
supautils_184.0.1el9.x86_64pigsty100.3 KiBsupautils_18-4.0.1-1PGSTY.el9.x86_64.rpm
supautils_184.0.1el9.aarch64pigsty98.3 KiBsupautils_18-4.0.1-1PGSTY.el9.aarch64.rpm
supautils_184.0.1el10.x86_64pigsty101.6 KiBsupautils_18-4.0.1-1PGSTY.el10.x86_64.rpm
supautils_184.0.1el10.aarch64pigsty99.3 KiBsupautils_18-4.0.1-1PGSTY.el10.aarch64.rpm
postgresql-18-supautils4.0.1d12.x86_64pigsty92.6 KiBpostgresql-18-supautils_4.0.1-1PGSTY~bookworm_amd64.deb
postgresql-18-supautils4.0.1d12.aarch64pigsty90.5 KiBpostgresql-18-supautils_4.0.1-1PGSTY~bookworm_arm64.deb
postgresql-18-supautils4.0.1d13.x86_64pigsty92.7 KiBpostgresql-18-supautils_4.0.1-1PGSTY~trixie_amd64.deb
postgresql-18-supautils4.0.1d13.aarch64pigsty90.7 KiBpostgresql-18-supautils_4.0.1-1PGSTY~trixie_arm64.deb
postgresql-18-supautils4.0.1u22.x86_64pigsty99.8 KiBpostgresql-18-supautils_4.0.1-1PGSTY~jammy_amd64.deb
postgresql-18-supautils4.0.1u22.aarch64pigsty98.0 KiBpostgresql-18-supautils_4.0.1-1PGSTY~jammy_arm64.deb
postgresql-18-supautils4.0.1u24.x86_64pigsty96.8 KiBpostgresql-18-supautils_4.0.1-1PGSTY~noble_amd64.deb
postgresql-18-supautils4.0.1u24.aarch64pigsty95.5 KiBpostgresql-18-supautils_4.0.1-1PGSTY~noble_arm64.deb
postgresql-18-supautils4.0.1u26.x86_64pigsty96.9 KiBpostgresql-18-supautils_4.0.1-1PGSTY~resolute_amd64.deb
postgresql-18-supautils4.0.1u26.aarch64pigsty95.1 KiBpostgresql-18-supautils_4.0.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
supautils_174.0.1el8.x86_64pigsty99.4 KiBsupautils_17-4.0.1-1PGSTY.el8.x86_64.rpm
supautils_174.0.1el8.aarch64pigsty96.7 KiBsupautils_17-4.0.1-1PGSTY.el8.aarch64.rpm
supautils_174.0.1el9.x86_64pigsty100.5 KiBsupautils_17-4.0.1-1PGSTY.el9.x86_64.rpm
supautils_174.0.1el9.aarch64pigsty98.4 KiBsupautils_17-4.0.1-1PGSTY.el9.aarch64.rpm
supautils_174.0.1el10.x86_64pigsty101.7 KiBsupautils_17-4.0.1-1PGSTY.el10.x86_64.rpm
supautils_174.0.1el10.aarch64pigsty99.2 KiBsupautils_17-4.0.1-1PGSTY.el10.aarch64.rpm
postgresql-17-supautils4.0.1d12.x86_64pigsty92.7 KiBpostgresql-17-supautils_4.0.1-1PGSTY~bookworm_amd64.deb
postgresql-17-supautils4.0.1d12.aarch64pigsty90.5 KiBpostgresql-17-supautils_4.0.1-1PGSTY~bookworm_arm64.deb
postgresql-17-supautils4.0.1d13.x86_64pigsty92.9 KiBpostgresql-17-supautils_4.0.1-1PGSTY~trixie_amd64.deb
postgresql-17-supautils4.0.1d13.aarch64pigsty90.7 KiBpostgresql-17-supautils_4.0.1-1PGSTY~trixie_arm64.deb
postgresql-17-supautils4.0.1u22.x86_64pigsty128.8 KiBpostgresql-17-supautils_4.0.1-1PGSTY~jammy_amd64.deb
postgresql-17-supautils4.0.1u22.aarch64pigsty126.8 KiBpostgresql-17-supautils_4.0.1-1PGSTY~jammy_arm64.deb
postgresql-17-supautils4.0.1u24.x86_64pigsty96.9 KiBpostgresql-17-supautils_4.0.1-1PGSTY~noble_amd64.deb
postgresql-17-supautils4.0.1u24.aarch64pigsty95.7 KiBpostgresql-17-supautils_4.0.1-1PGSTY~noble_arm64.deb
postgresql-17-supautils4.0.1u26.x86_64pigsty96.9 KiBpostgresql-17-supautils_4.0.1-1PGSTY~resolute_amd64.deb
postgresql-17-supautils4.0.1u26.aarch64pigsty95.2 KiBpostgresql-17-supautils_4.0.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
supautils_164.0.1el8.x86_64pigsty99.8 KiBsupautils_16-4.0.1-1PGSTY.el8.x86_64.rpm
supautils_164.0.1el8.aarch64pigsty97.1 KiBsupautils_16-4.0.1-1PGSTY.el8.aarch64.rpm
supautils_164.0.1el9.x86_64pigsty100.5 KiBsupautils_16-4.0.1-1PGSTY.el9.x86_64.rpm
supautils_164.0.1el9.aarch64pigsty98.5 KiBsupautils_16-4.0.1-1PGSTY.el9.aarch64.rpm
supautils_164.0.1el10.x86_64pigsty102.0 KiBsupautils_16-4.0.1-1PGSTY.el10.x86_64.rpm
supautils_164.0.1el10.aarch64pigsty99.6 KiBsupautils_16-4.0.1-1PGSTY.el10.aarch64.rpm
postgresql-16-supautils4.0.1d12.x86_64pigsty92.9 KiBpostgresql-16-supautils_4.0.1-1PGSTY~bookworm_amd64.deb
postgresql-16-supautils4.0.1d12.aarch64pigsty90.6 KiBpostgresql-16-supautils_4.0.1-1PGSTY~bookworm_arm64.deb
postgresql-16-supautils4.0.1d13.x86_64pigsty93.1 KiBpostgresql-16-supautils_4.0.1-1PGSTY~trixie_amd64.deb
postgresql-16-supautils4.0.1d13.aarch64pigsty91.0 KiBpostgresql-16-supautils_4.0.1-1PGSTY~trixie_arm64.deb
postgresql-16-supautils4.0.1u22.x86_64pigsty124.9 KiBpostgresql-16-supautils_4.0.1-1PGSTY~jammy_amd64.deb
postgresql-16-supautils4.0.1u22.aarch64pigsty122.8 KiBpostgresql-16-supautils_4.0.1-1PGSTY~jammy_arm64.deb
postgresql-16-supautils4.0.1u24.x86_64pigsty97.2 KiBpostgresql-16-supautils_4.0.1-1PGSTY~noble_amd64.deb
postgresql-16-supautils4.0.1u24.aarch64pigsty95.7 KiBpostgresql-16-supautils_4.0.1-1PGSTY~noble_arm64.deb
postgresql-16-supautils4.0.1u26.x86_64pigsty97.3 KiBpostgresql-16-supautils_4.0.1-1PGSTY~resolute_amd64.deb
postgresql-16-supautils4.0.1u26.aarch64pigsty95.7 KiBpostgresql-16-supautils_4.0.1-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
supautils_154.0.1el8.x86_64pigsty100.9 KiBsupautils_15-4.0.1-1PGSTY.el8.x86_64.rpm
supautils_154.0.1el8.aarch64pigsty97.9 KiBsupautils_15-4.0.1-1PGSTY.el8.aarch64.rpm
supautils_154.0.1el9.x86_64pigsty102.3 KiBsupautils_15-4.0.1-1PGSTY.el9.x86_64.rpm
supautils_154.0.1el9.aarch64pigsty99.9 KiBsupautils_15-4.0.1-1PGSTY.el9.aarch64.rpm
supautils_154.0.1el10.x86_64pigsty103.1 KiBsupautils_15-4.0.1-1PGSTY.el10.x86_64.rpm
supautils_154.0.1el10.aarch64pigsty101.2 KiBsupautils_15-4.0.1-1PGSTY.el10.aarch64.rpm
postgresql-15-supautils4.0.1d12.x86_64pigsty94.5 KiBpostgresql-15-supautils_4.0.1-1PGSTY~bookworm_amd64.deb
postgresql-15-supautils4.0.1d12.aarch64pigsty91.8 KiBpostgresql-15-supautils_4.0.1-1PGSTY~bookworm_arm64.deb
postgresql-15-supautils4.0.1d13.x86_64pigsty94.8 KiBpostgresql-15-supautils_4.0.1-1PGSTY~trixie_amd64.deb
postgresql-15-supautils4.0.1d13.aarch64pigsty92.1 KiBpostgresql-15-supautils_4.0.1-1PGSTY~trixie_arm64.deb
postgresql-15-supautils4.0.1u22.x86_64pigsty126.0 KiBpostgresql-15-supautils_4.0.1-1PGSTY~jammy_amd64.deb
postgresql-15-supautils4.0.1u22.aarch64pigsty123.7 KiBpostgresql-15-supautils_4.0.1-1PGSTY~jammy_arm64.deb
postgresql-15-supautils4.0.1u24.x86_64pigsty98.6 KiBpostgresql-15-supautils_4.0.1-1PGSTY~noble_amd64.deb
postgresql-15-supautils4.0.1u24.aarch64pigsty97.0 KiBpostgresql-15-supautils_4.0.1-1PGSTY~noble_arm64.deb
postgresql-15-supautils4.0.1u26.x86_64pigsty98.4 KiBpostgresql-15-supautils_4.0.1-1PGSTY~resolute_amd64.deb
postgresql-15-supautils4.0.1u26.aarch64pigsty96.7 KiBpostgresql-15-supautils_4.0.1-1PGSTY~resolute_arm64.deb

Source

pig build pkg supautils;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install supautils;		# install by package name

pig install supautils -v 19;   # install for PG 19
pig install supautils -v 18;   # install for PG 18
pig install supautils -v 17;   # install for PG 17
pig install supautils -v 16;   # install for PG 16
pig install supautils -v 15;   # install for PG 15

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'supautils';

This extension does not need CREATE EXTENSION DDL command

Usage

Sources:

supautils is a loadable library that unlocks selected superuser-only PostgreSQL features for non-superusers through configuration. Upstream emphasizes that it adds no tables, functions, or security labels to the database.

Load it

Cluster-wide:

shared_preload_libraries = 'supautils'
supautils.privileged_role = 'your_privileged_role'

Per role:

ALTER ROLE role1 SET session_preload_libraries TO 'supautils';

Privileged role capabilities

The README documents a privileged proxy role that can create publications, foreign data wrappers, event triggers, and privileged extensions without granting SUPERUSER.

SET ROLE privileged_role;
CREATE PUBLICATION p FOR ALL TABLES;
DROP PUBLICATION p;

For event triggers, the README says privileged-role triggers run for non-superusers, skip superusers, and also skip reserved roles. It also documents one limitation: those triggers do not fire while creating publications, foreign data wrappers, or extensions.

Important configuration knobs

  • supautils.superuser
  • supautils.privileged_role
  • supautils.privileged_role_allowed_configs
  • supautils.privileged_extensions
  • supautils.extension_custom_scripts_path
  • supautils.extensions_parameter_overrides
  • supautils.policy_grants
  • supautils.drop_trigger_grants
  • supautils.reserved_roles
  • supautils.reserved_memberships
  • supautils.hint_roles
  • supautils.log_skipped_evtrigs

Useful examples

Allow a non-superuser to create specific privileged extensions:

supautils.privileged_extensions = 'hstore'

Allow a role to manage RLS policies on tables it does not own:

supautils.policy_grants = '{ "my_role": ["public.not_my_table"] }'

Force an extension into a specific schema on CREATE EXTENSION:

supautils.extensions_parameter_overrides = '{ "pg_cron": { "schema": "pg_catalog" } }'

Protect managed-service roles from CREATEROLE users:

supautils.reserved_roles = 'connector, storage_admin'
supautils.reserved_memberships = 'pg_read_server_files'

Version Selection and Operational Boundaries

supautils.restrict_extension_versions controls explicit version clauses for non-superusers: off allows them, warn ignores them and selects the control-file default with a warning, and error rejects them. This applies to both extension creation and upgrades; superusers and the configured proxy superuser are exempt. Omitting an explicit version remains allowed subject to normal privilege checks.

Cluster preload requires a restart; role-specific session preload applies to new connections. Do not run CREATE EXTENSION for supautils itself. Source release 4.0.0 is a library update and has no SQL extension-update step. It avoids ACCESS EXCLUSIVE locks during allowlisted-table policy checks and restores the caller’s role on every exit from an elevated region.

Review allowed extensions and custom scripts as trusted code because their operations run with delegated superuser privileges. Enhanced privilege hints do not work for views on PostgreSQL 18 according to the tagged README. Test role transitions, event-trigger ownership and reserved-role protections before broadening grants.

4.0 Migration

Version 4.0.0 removes constrained-extension functionality; remove the old constrained_extensions configuration rather than relying on that mechanism. Global and per-extension custom scripts run in this order: global before-create, extension before-create, extension after-create, global after-create. The default_extension_install_schema setting prepends a default schema when no explicit SCHEMA or parameter override wins. The read-only supautils.version setting identifies the loaded library. These are library changes; restart or reconnect the processes that preload it, without CREATE EXTENSION for supautils itself.

4.0.1 fixes

Version 4.0.1 guards role lookups for statements without a role, corrects extension authorization, and runs dependent custom scripts when no dependency cycle exists. It remains a preloaded module with no CREATE EXTENSION command. Replace the matching library and restart processes using it; verify delegated administration and custom-script policy after upgrade.

Table reader