select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Extensions / Procedural languages

plpgsql

PL/pgSQL procedural language

pgext.cloud · Website · Documentation · License text · Control file

Overview

Packageplpgsql
Version1.0
PostgreSQL versions14 · 15 · 16 · 17 · 18
RepositoryPostgreSQL contrib
Extension typeStandard
Requires CREATE EXTENSIONYes
Requires preloadNo
TrustedYes
RelocatableNo
Schemapg_catalog
Latest commit2026-05-14
Latest release2026-05-14
Catalogue updated2026-07-29

Related extensions

Required by

bedquiltA json object store
biscuitIAM-LIKE pattern matching with bitmap indexing
cat_toolsTools for interfacing with the PostgreSQL catalog
check_orapgValidate Oracle-to-PostgreSQL or EDB migrations by comparing database objects, privileges, attributes, comments, and row counts.
currencyCustom PostgreSQL currency type in 1Byte
data_historizationPLPGSQL Script to historize data in partitionned table
db2fceDB2 compatibility functions, types, operators, and SYSIBM.SYSDUMMY1 for PostgreSQL.
dbpatchPostgreSQL database patch change management extension
dbstatCollects exact table row counts and modification timing through SQL objects and a companion libpq process.
ddl_historizationHistorize the ddl changes inside PostgreSQL database
drop_role_helperGenerates SQL to revoke all privileges held by a role in the current database.
dsefDiffStats and ExplainFull: detailed SQL reports for third party help & support
event_managerLoosely coupled PostgreSQL event trigger and queue system with synchronous or asynchronous processing.
explanationEXPLAIN plan parser that returns plan nodes as relational rows organized as a proximity tree.
fireflyPostGIS-backed Firefly database schema for tracking 3D points and add/delete operations by task.
geekspeakDatabase schema extension for the GeekSpeak podcast website.
generic_planGenerate a generic plan for a parameterized SQL statement.
gogudbPostgreSQL extension for distributed hash and range partitioning across foreign servers.
grants_managerDeclarative PL/pgSQL toolkit for snapshotting, reporting, and aligning database object grants.
hello-worldRLS demo extension with users and products tables
hybrid_searchHybrid pgvector and full-text search helper functions for LangChain and Supabase.
index_analyzerPL/pgSQL functions for evaluating existing and prospective indexes and checking foreign-key indexing.
istoriaTable history management with non-linear undo/redo
italian_codesValidation domains for Italian fiscal and VAT codes
job_queueProof-of-concept database-side asynchronous job queue using dynamic PostgreSQL background workers.
json_queryGenerate PostgreSQL WHERE clause predicates from JSONB filter objects.
json_utilsJSON type helper functions, operators, and a hash operator class for PostgreSQL 9.2+.
jsonb_schemajsonb with separately stored schema
jx_ioExtension to export and import json and xml from/to postgres
keyhippoRLS-compatible API keys for PostgreSQL
kilobasePreloaded pgrx background worker for scheduling and refreshing PostgreSQL materialized views.
kissfftFast-Fourier transformer (fft)
lab-orderspgpm demo for the Postgres Conference 2026
launchql-base32RFC6238 TOTP implementation in pure PostgreSQL plpgsql
launchql-ext-types🛠. basic pg utils
launchql-extension-utilsPostgreSQL utilities
launchql-extension-verifyPostgreSQL verification utilities
launchql-inflectioninflection is a port of the functionality from Ruby on Rails' Active Support Inflection classes into PostgreSQL
launchql-jwt-claimslaunchql-jwt-claims extension
launchql-stamps🛠. basic pg utils
launchql-totp🛠. basic pg utils
livewirepower delivery modeling
medicationsmedications extension
merge_ipsFunctions to merge IP addresses, ignoring gaps
meta_triggersInsert, update and delete triggers for the meta system catalog
migrationDatabase Migrations: Configure and Run
monitoring_roleSecurity-definer monitoring wrappers for a non-privileged role
mv_rewriteQuery rewriting extension that transparently rewrites queries to use lower-cost materialized views.
mv_statsTracks creation, alteration, refresh, and reset statistics for materialized views.
myhelperCollection of PostgreSQL helper functions
mypg_shardingmypg sharding utilities for PostgreSQL
mysqlcompatMySQL compatibility functions, aggregates, operators, and casts for PostgreSQL porting.
newsfeedsPostgreSQL extension for gathering news
nfiesta_gisdatanfi gisdata database
nfiesta_sdesignPostgreSQL extension for manipulating sampling design data.
nfiesta_target_dataPostgreSQL extension for manipulation of target data - aggregation of local density contributions at the plot level.
nonomsNormalised nomenclatural system for managing biological names and taxonomic understandings in PostgreSQL.
normNo-ORM helper extension that generates simple CRUD functions.
npmSchema and tables for tracking npm package metadata and daily download counts.
ollamaOllama client for PostgreSQL
omnidb_plpgsql_debuggerPostgreSQL extension for enabling PL/pgSQL debugger in OmniDB
partman_to_cstoreMove old pg_partman partitions to cstore columnar storage.
pasePostgreSQL ultra-high dimensional approximate nearest neighbor search extension.
pathman_shardingImproved sharding for pg_pathman.
patientspatients extension
pg-audit-jsonTrigger-based PostgreSQL table auditing with JSONB row snapshots and recursive change diffs.
pg2podgPostgreSQL extension for two-player open deterministic games.
pg4mlMachine learning framework for PostgreSQL
pgAutomatorDatabase logic for the pgAutomator job scheduling system.
pg_abrisAbris metadata extension that creates a meta schema with metadata tables, views, and helper functions.
pg_accumulatorAccumulation registers for balance and turnover tracking in PostgreSQL
pg_auditAn extension for creating audit tables
pg_audit_toolsPostgreSQL extension for audit tables management
pg_biscuitA fast bitmap-based index for PostgreSQL
pg_blevePostgreSQL extension for Bleve search integration
pg_bm25Full text search for PostgreSQL using BM25
pg_cache_treeCaches recursive parent and child IDs in array columns using trigger and helper functions.
pg_calcpiComputes digits of pi in PostgreSQL with a PL/pgSQL spigot algorithm.
pg_catalog_get_defsAdds PL/pgSQL functions that reconstruct CREATE TYPE definitions from pg_catalog metadata.
pg_column_tetrisEnforce optimal column alignment to minimize row padding
pg_credereumCryptographically verifiable database auditing backed by blockchain-style transaction blocks.
pg_datatype_passwordSQL-only password data type and operators using pgcrypto Blowfish hashes, with trigger-based encryption before storage.
pg_dbo_timestampPostgreSQL extension for storing time and author of database structure modification.
pg_dbwaAnalyzes local or remote PostgreSQL workloads using historical pg_stat_statements snapshots.
pg_dmsDocument management system with custom ID, family, and reference types plus action tracking and JSON registry helpers.
pg_drop_eventslogs transaction ids of drop table, drop column, drop materialized view statements
pg_dropbuffersDrop PostgreSQL shared buffers and the operating-system page cache for testing
pg_dropcacheInvalidate PostgreSQL shared_buffers cache for a database or relation
pg_eyesSQL monitoring functions and views for PostgreSQL database activity
pg_fairmlqPL/pgSQL only implementation of a fair multi-level queue for multi-tenant applications
pg_fsqlRecursive SQL template engine with JSONB-driven execution
pg_gen_uidAdds a PL/pgSQL function that generates random lowercase alphanumeric identifiers using pgcrypto.
pg_gitImplements Git-like repositories, commits, branches, merges and remote operations using PostgreSQL-native data and functions.
pg_graphql_serverRuns an HTTP GraphQL endpoint from a PostgreSQL background worker and delegates queries to pg_graphql.
pg_gslWraps selected GNU Scientific Library routines, including real FFT transforms and helper functions, for PostgreSQL.
pg_idmExposes PostgreSQL role and membership management through updatable views and DML-trigger functions.
pg_idx_advisorPostgreSQL index advisor
pg_lake_icebergIceberg implementation in Postgres
pg_landmetricsA PostgreSQL/PostGIS extension for calculating landscape metrics.
pg_ledgerProvides a double-entry accounting engine with immutable journals, fiscal periods, currencies and posting rules inside PostgreSQL.
pg_linegazerTransparent code coverage for PL/pgSQL
pg_llm_helperCaptures PostgreSQL errors in shared memory and exposes history plus an optional pgai-backed LLM troubleshooting function.
pg_lock_poolWait on a PostgreSQL advisory lock pool
pg_message_queueListen/Notify-based PostgreSQL message queue extension
pg_monitoringProvides a common SQL interface for collecting PostgreSQL replication, table-load and database-load monitoring statistics.
pg_normalize_emailNormalize email addresses in PostgreSQL
pg_onceRun‑once / idempotency‑key manager with TTL and response caching
pg_osPostgreSQL extension providing operating system-level functionality directly through SQL, enabling process management, file system operations, IPC, and system monitoring within the database environment.
pg_osgrOrdnance Survey grid reference handling for biological recording
pg_pageprepPrepares heap pages on PostgreSQL or Postgres Pro Standard for migration to the 64-bit-XID page format used by Postgres Pro Enterprise.
pg_partTable partitioning utility for PostgreSQL
pg_particulousMigrate tables between vanilla PostgreSQL and pg_pathman partitioning
pg_partmanExtension to manage partitioned tables by time or ID
pg_pathmanPartitioning tool for PostgreSQL
pg_paxosPaxos distributed consensus functions and table replication for PostgreSQL
pg_popyramids_datamartsCreates population-pyramid analytics data-mart objects in a hard-coded dms schema from a pre-existing ods schema.
pg_profilePostgreSQL load profile repository and report builder
pg_prometheusPrometheus metric sample type and helpers for PostgreSQL.
pg_prttn_toolsProvides PL/pgSQL tools for managing inheritance-based partition tables.
pg_reactiveLive SQL query subscriptions with result deltas over LISTEN/NOTIFY
pg_reversiReversi game implemented as a PostgreSQL extension.
pg_sakila_dbPostgreSQL extension for deploying a port of the Sakila example database.
pg_semantic_cacheCaches query results and retrieves semantically similar results using pgvector embeddings and configurable eviction policies.
pg_sendmailSends email from SQL by invoking a sendmail-compatible executable at a fixed server path.
pg_sentence_transformerRuns a Hugging Face sentence-transformer model inside a preload background worker and maintains pgvector embeddings for a configured table.
pg_sessionsTracks per-session SQL execution metrics and optional Linux process resource statistics in shared memory.
pg_shardmanManages PostgreSQL 10 hash-sharded tables across nodes using pg_pathman, postgres_fdw, and logical replication.
pg_statvizCapture PostgreSQL statistics snapshots for time-series analysis and visualization
pg_tilelessTools for packaging twkb in sqlite for tileless
pg_tmsfunctions to tile rasters in TMS format
pg_turboquantCompact TurboQuant approximate-nearest-neighbor index access method for pgvector vector and halfvec data.
pg_twkbTWKB tools etc
pg_uplessDetect Useless UPDATE
pg_zlogLogical table replication using Ceph and ZLog
pgautAuto Update Timestamp for PostgreSQL
pgcatEnhanced logical replication extension for per-table subscriptions, table mapping, and replica-identity tracking.
pgeyesPL/pgSQL administrative helper extension with a pgeyes() environment check and foreign_db metadata table.
pgfsmFinite State Machine enforcement with triggers and util functions.
pgh_consistencyPfafstetter consistency checks for PgHydro
pgh_hgmHydrogeomorphological analysis extension for PgHydro
pgh_outputOutput and reporting objects for PgHydro
pgh_output_en_auAustralian English output pack for PgHydro
pgh_output_pt_brBrazilian Portuguese output pack for PgHydro
pgh_rasterRaster hydrology extension for PgHydro
pghydroDrainage network analysis core for PostgreSQL and PostGIS
pgmockSQL/PLpgSQL extension for mocking function and table dependencies in PostgreSQL unit tests
pgnatsNATS messaging integration with publish, subscribe, JetStream, key-value, and object store SQL APIs
pgpartsSQL/PLpgSQL helper extension for creating and maintaining table partitions with triggers
pgpm-base32PostgreSQL modules using the pgpm workflow for safe, testable, reversible SQL changes.
pgpm-defaultsPostgreSQL modules using the pgpm workflow for safe, testable, reversible SQL changes.
pgpm-fakerPostgreSQL modules using the pgpm workflow for safe, testable, reversible SQL changes.
pgpm-inflectionPostgreSQL modules using the pgpm workflow for safe, testable, reversible SQL changes.
pgpm-jwt-claimsAgentic DB - Give your agent a brain
pgpm-measurementsPostgreSQL modules using the pgpm workflow for safe, testable, reversible SQL changes.
pgpm-typesPostgreSQL modules using the pgpm workflow for safe, testable, reversible SQL changes.
pgpm-verifypgpm-verify extension
pgraoPGRAO Postgres DB Catalog Extension
pgrollupcreate rollup tables for fast aggregate queries
pgroutingpgRouting Extension
pgsqlmockMocking and faking helpers for PostgreSQL unit tests
pgtapUnit testing for PostgreSQL
pgtap_fixtureA PostgreSQL extension that allows more complex fixtures to be created for pgTAP tests.
pgtelemetryProvides monitoring views and functions for PostgreSQL activity, storage, locks, replication, WAL, vacuum, and query statistics.
pgvroomVROOM functionality reached from the database
plparrotParrot Virtual Machine and Rakudo Perl 6 as PostgreSQL procedural languages
plpgsql_checkAdditional validation, profiling, and diagnostics for PL/pgSQL functions
plpgsql_wrapOracle WRAP-equivalent PL/pgSQL language handler storing AES-256-GCM encrypted procedure source.
plrustCompiles Rust functions to native code as a PostgreSQL procedural language, with optional postgrestd-backed trusted sandboxing.
postgres_ciImplements the database backend for the defunct Postgres-CI service, including users, projects, builds, hooks, sessions, and notifications.
postpicA PostgreSQL image type with SQL image-processing and metadata functions, backed by GraphicsMagick, plus import/export utilities.
powaPostgreSQL Workload Analyser-core
prescriptionspgpm demo for the Postgres Conference 2026
qgresSimple queue system
quriaquria: experimental pgrx extension for BM25 full-text and HNSW vector search
range_partitioningManages trigger-based static range partitions for PostgreSQL-XL, including split and merge operations.
recallTracks table changes in per-table _log tables for timestamp-based history queries.
recursively_deleteRecursively delete rows and their foreign-key dependents
rep_fdwReplicate table changes to another PostgreSQL server through postgres_fdw
rls_helpersPL/pgSQL procedures for simulating Supabase authenticated and anonymous roles while testing row-level security policies.
rolemanParameterized role and privilege management functions for PostgreSQL.
rpgR-inspired PL/pgSQL data manipulation functions.
rtilesRust/PostGIS extension for serving configurable Mapbox Vector Tile layers for self-hosted interactive maps.
schedulingpgpm demo for the Postgres Conference 2026
session_variablesSQL functions for storing and retrieving session-scoped values through custom PostgreSQL settings.
short_idsPL/pgSQL generator for short random text IDs with collision checks and transaction advisory locks.
skitch-extension-defaultsdefault roles
skitch-extension-jobsAn asynchronous job queue schema for ACID compliant job creation
skitch-extension-utilsPostgreSQL utilities
skitch-extension-verifyPL/pgSQL catalog-verification functions for checking PostgreSQL objects, roles, privileges, policies, and other schema properties.
sphinxlinkC extension for issuing SphinxSearch or ManticoreSearch queries from PostgreSQL through the MySQL-compatible protocol.
sql_sagaC and PL/pgSQL extension for valid-time temporal tables, temporal foreign keys, history-preserving views, and bulk temporal merge operations.
supa_queueSimple PostgreSQL job queue that dispatches asynchronous HTTP requests with pg_net, schedules processing and retries with pg_cron, and stores endpoint credentials in Supabase Vault.
supabaseA friendly playground for building and validating Supabase Row‑Level Security (RLS)
supabase_auth_apikeySupabase Auth API-key helpers for creating, deleting, validating, and authorizing user API keys.
sys_syn_dblinkPL/pgSQL synchronization processor that pulls sys_syn queues over named dblink connections, transforms batches, writes local tables, and returns processing status to the source database.
tab_tierPL/pgSQL extension for job-driven retention, tiering, and date-based table partition maintenance.
table_log_plPL/pgSQL drop-in replacement for the table_log trigger-based DML auditing extension.
table_versionPostgreSQL table versioning extension
tablelogTrigger-based audit and change-data-capture extension that records INSERT, UPDATE, and DELETE row images in a central log table and can generate replay SQL.
telephonePostgreSQL data type for normalized telephone numbers with dialing-plan validation.
test_factoryFramework for registering, creating, caching, and reusing named PostgreSQL test data sets.
time_for_keysC and PL/pgSQL helpers that enforce temporal foreign keys between valid-time tables with constraint triggers.
timestampandtzC data type that stores a timestamp together with its source time-zone identity, with casts, operators, indexing, and date/time functions.
townMinimal PL/pgSQL helper that creates JSONB-and-array time-series tables with GIN and GiST indexes.
typesReusable domains for attachments, email addresses, hostnames, images, uploads, and URLs.
unitSI units extension
unitsUnit conversion table and PL/pgSQL conversion function for length units.
us-statespgpm demo for the Postgres Conference 2026
uuidv7-sqlPure SQL and PL/pgSQL functions for generating, inspecting, and transforming UUID version 7 values.
variantVariant data type that can store values from other PostgreSQL types.
vectorsVector database plugin for PostgreSQL, written in Rust, specifically designed for LLM
vrproutingVehicle Routing Problems on the Database
wasmA Postgres extension to run WebAssembly binaries.
webauthnPure-SQL PostgreSQL implementation of WebAuthn credential registration and assertion verification.
xl_global_viewsCreates global pgxl_ views over Postgres-XL nodes based on pg_ views.
zombodbElasticsearch-backed full-text search and indexing for PostgreSQL

See also

plxTranspile multiple procedural dialects to PL/pgSQL
plisqlPL/iSQL procedural language
plpgsql_checkAdditional validation, profiling, and diagnostics for PL/pgSQL functions
pldbgapiserver-side support for debugging PL/pgSQL functions
plpgsql_wrapOracle WRAP-equivalent PL/pgSQL language handler storing AES-256-GCM encrypted procedure source.
orafceFunctions and operators that emulate a subset of functions and packages from the Oracle RDBMS
plprofilerserver-side support for profiling PL/pgSQL functions
plshPL/sh procedural language
pljavaPL/Java procedural language
pglinterPostgreSQL Linting and Analysis Extension