Skip to content

supabase_vault

Supabase Vault Extension

pg_vault · Supabase Vault Extension

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
7050supabase_vaultpg_vault0.3.2SECApache-2.0C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d--NoYesNoYesnono
Package and SQL version 0.3.2; restrict decrypted view access; keep plaintext out of logs; pgsodium is not required; the package uses system libsodium.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY0.3.219 18 17 16 15pg_vault-
RPMPIGSTY0.3.219 18 17 16 15vault_$v-
DEBPIGSTY0.3.219 18 17 16 15postgresql-$v-vault-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
el8.aarch64N/APIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
el9.x86_64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
el9.aarch64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
el10.x86_64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
el10.aarch64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
d12.x86_64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
d12.aarch64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
d13.x86_64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
d13.aarch64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
u22.x86_64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
u22.aarch64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
u24.x86_64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
u24.aarch64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
u26.x86_64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2
u26.aarch64PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2PIGSTY 0.3.2

Source

pig build pkg pg_vault;		# 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 pg_vault;		# install by package name
pig install supabase_vault;		# install by extension name

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

Create this extension with:

CREATE EXTENSION supabase_vault;

Usage

Sources:

supabase_vault 0.3.2 stores encrypted secrets in PostgreSQL and exposes decrypted values through a privileged view. Its fixed schema is vault; the current release no longer requires pgsodium. Upstream tests PostgreSQL 14–19. Install as a superuser; no preload or restart is required.

Core Workflow

The following values are demonstration strings, not real credentials:

CREATE EXTENSION supabase_vault;
SELECT vault.create_secret('example-secret', 'api_token', 'Demo only');
SELECT name, decrypted_secret FROM vault.decrypted_secrets WHERE name = 'api_token';
SELECT vault.update_secret(id, 'replacement-example', 'api_token', 'Rotated demo')
FROM vault.secrets WHERE name = 'api_token';

vault.create_secret returns the secret UUID and accepts optional name and description. vault.update_secret updates a selected UUID. vault.secrets holds encrypted values and metadata; vault.decrypted_secrets exposes plaintext to roles allowed to read it. Restrict both helper and view privileges deliberately.

Security and Upgrade

Version 0.3.2 moves pg_temp to the end of the search path used by secret creation/update helpers. After installing its files, run ALTER EXTENSION supabase_vault UPDATE TO '0.3.2' in each database.

Encryption at rest does not prevent authorized queries from returning plaintext. Secret literals and returned values can appear in database logs, client histories or application telemetry; use the documented secret workflow and configure those systems appropriately. Protect the encryption-key environment and verify backup/restore behavior. Do not treat access to the decrypted view as safe merely because the stored table is encrypted.

Table reader