Skip to content
pg_tle

pg_tle

pg_tle : Trusted Language Extensions for PostgreSQL

Overview

ID Extension Package Version Category License Language
3000
pg_tle
pg_tle
1.5.2
LANG
Apache-2.0
C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--sLd--
No
Yes
Yes
Yes
no
no
Relationships
Schemas pgtle
See Also
plv8
pljs
pgwasm
pllua
pg_extension_base
pgextwlist
pg_readme

require bison flex to build

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PIGSTY
1.5.2
18
17
16
15
14
pg_tle -
RPM
PGDG
1.5.2
18
17
16
15
14
pg_tle_$v -
DEB
PIGSTY
1.5.2
18
17
16
15
14
postgresql-$v-pg-tle -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
el8.aarch64
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
el9.x86_64
PGDG 1.5.2
PGDG 1.5.2
PGDG 1.5.2
PGDG 1.5.2
PGDG 1.5.2
el9.aarch64
PGDG 1.5.2
PGDG 1.5.2
PGDG 1.5.2
PGDG 1.5.2
PGDG 1.5.2
el10.x86_64
PGDG 1.5.2
PGDG 1.5.2
PGDG 1.5.2
PGDG 1.5.2
PGDG 1.5.2
el10.aarch64
PGDG 1.5.2
PGDG 1.5.2
PGDG 1.5.2
PGDG 1.5.2
PGDG 1.5.2
d12.x86_64
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
d12.aarch64
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
d13.x86_64
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
d13.aarch64
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
u22.x86_64
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
u22.aarch64
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
u24.x86_64
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
u24.aarch64
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
u26.x86_64
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
u26.aarch64
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
PIGSTY 1.5.2
Package Version OS ORG SIZE File URL
pg_tle_18 1.5.2 el8.x86_64 pigsty 68.8 KiB pg_tle_18-1.5.2-1PIGSTY.el8.x86_64.rpm
pg_tle_18 1.5.2 el8.x86_64 pgdg 68.7 KiB pg_tle_18-1.5.2-1PGDG.rhel8.x86_64.rpm
pg_tle_18 1.5.2 el8.aarch64 pigsty 65.4 KiB pg_tle_18-1.5.2-1PIGSTY.el8.aarch64.rpm
pg_tle_18 1.5.2 el8.aarch64 pgdg 65.3 KiB pg_tle_18-1.5.2-1PGDG.rhel8.aarch64.rpm
pg_tle_18 1.5.2 el9.x86_64 pgdg 65.2 KiB pg_tle_18-1.5.2-3PGDG.rhel9.8.x86_64.rpm
pg_tle_18 1.5.2 el9.x86_64 pigsty 63.0 KiB pg_tle_18-1.5.2-1PIGSTY.el9.x86_64.rpm
pg_tle_18 1.5.2 el9.x86_64 pgdg 65.1 KiB pg_tle_18-1.5.2-1PGDG.rhel9.x86_64.rpm
pg_tle_18 1.5.2 el9.aarch64 pgdg 62.4 KiB pg_tle_18-1.5.2-3PGDG.rhel9.8.aarch64.rpm
pg_tle_18 1.5.2 el9.aarch64 pigsty 59.9 KiB pg_tle_18-1.5.2-1PIGSTY.el9.aarch64.rpm
pg_tle_18 1.5.2 el9.aarch64 pgdg 62.1 KiB pg_tle_18-1.5.2-1PGDG.rhel9.aarch64.rpm
pg_tle_18 1.5.2 el10.x86_64 pgdg 65.6 KiB pg_tle_18-1.5.2-3PGDG.rhel10.2.x86_64.rpm
pg_tle_18 1.5.2 el10.x86_64 pigsty 63.3 KiB pg_tle_18-1.5.2-1PIGSTY.el10.x86_64.rpm
pg_tle_18 1.5.2 el10.x86_64 pgdg 65.8 KiB pg_tle_18-1.5.2-1PGDG.rhel10.x86_64.rpm
pg_tle_18 1.5.2 el10.aarch64 pgdg 63.2 KiB pg_tle_18-1.5.2-3PGDG.rhel10.2.aarch64.rpm
pg_tle_18 1.5.2 el10.aarch64 pigsty 60.6 KiB pg_tle_18-1.5.2-1PIGSTY.el10.aarch64.rpm
pg_tle_18 1.5.2 el10.aarch64 pgdg 63.3 KiB pg_tle_18-1.5.2-1PGDG.rhel10.aarch64.rpm
postgresql-18-pg-tle 1.5.2 d12.x86_64 pigsty 159.9 KiB postgresql-18-pg-tle_1.5.2-1PIGSTY~bookworm_amd64.deb
postgresql-18-pg-tle 1.5.2 d12.aarch64 pigsty 155.1 KiB postgresql-18-pg-tle_1.5.2-1PIGSTY~bookworm_arm64.deb
postgresql-18-pg-tle 1.5.2 d13.x86_64 pigsty 160.1 KiB postgresql-18-pg-tle_1.5.2-1PIGSTY~trixie_amd64.deb
postgresql-18-pg-tle 1.5.2 d13.aarch64 pigsty 155.4 KiB postgresql-18-pg-tle_1.5.2-1PIGSTY~trixie_arm64.deb
postgresql-18-pg-tle 1.5.2 u22.x86_64 pigsty 168.8 KiB postgresql-18-pg-tle_1.5.2-1PIGSTY~jammy_amd64.deb
postgresql-18-pg-tle 1.5.2 u22.aarch64 pigsty 165.3 KiB postgresql-18-pg-tle_1.5.2-1PIGSTY~jammy_arm64.deb
postgresql-18-pg-tle 1.5.2 u24.x86_64 pigsty 162.5 KiB postgresql-18-pg-tle_1.5.2-1PIGSTY~noble_amd64.deb
postgresql-18-pg-tle 1.5.2 u24.aarch64 pigsty 159.8 KiB postgresql-18-pg-tle_1.5.2-1PIGSTY~noble_arm64.deb
postgresql-18-pg-tle 1.5.2 u26.x86_64 pigsty 160.8 KiB postgresql-18-pg-tle_1.5.2-1PIGSTY~resolute_amd64.deb
postgresql-18-pg-tle 1.5.2 u26.aarch64 pigsty 158.6 KiB postgresql-18-pg-tle_1.5.2-1PIGSTY~resolute_arm64.deb

Source

pig build pkg pg_tle;		# 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_tle;		# install via package name, for the active PG version

pig install pg_tle -v 18;   # install for PG 18
pig install pg_tle -v 17;   # install for PG 17
pig install pg_tle -v 16;   # install for PG 16
pig install pg_tle -v 15;   # install for PG 15
pig install pg_tle -v 14;   # install for PG 14

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'pg_tle';

Create this extension with:

CREATE EXTENSION pg_tle;

Usage

pg_tle: Trusted Language Extensions for PostgreSQL

pg_tle lets you create and manage PostgreSQL extensions using trusted languages (SQL, PL/pgSQL, PL/v8, PL/Perl) without requiring filesystem access or server restarts.

Add pg_tle to shared_preload_libraries in postgresql.conf:

shared_preload_libraries = 'pg_tle'

Install a TLE Extension

SELECT pgtle.install_extension(
  'my_extension',      -- extension name
  '1.0',               -- version
  'My custom extension', -- description
  $_pgtle_$
    CREATE FUNCTION my_func() RETURNS text AS $$
      SELECT 'hello from my_extension';
    $$ LANGUAGE SQL;
  $_pgtle_$
);

Manage Extension Versions

-- Add an upgrade path
SELECT pgtle.install_update_path(
  'my_extension',  -- extension name
  '1.0',           -- from version
  '1.1',           -- to version
  $_pgtle_$
    CREATE OR REPLACE FUNCTION my_func() RETURNS text AS $$
      SELECT 'hello from my_extension v1.1';
    $$ LANGUAGE SQL;
  $_pgtle_$
);

-- Set default version
SELECT pgtle.set_default_version('my_extension', '1.1');

Use the TLE Extension

CREATE EXTENSION my_extension;
SELECT my_func();  -- 'hello from my_extension'
ALTER EXTENSION my_extension UPDATE TO '1.1';

Remove a TLE Extension

DROP EXTENSION my_extension;
SELECT pgtle.uninstall_extension('my_extension');

Hooks and Features

Register custom hooks (e.g., password check hooks):

SELECT pgtle.register_feature('my_password_check', 'passcheck');
SELECT pgtle.unregister_feature('my_password_check', 'passcheck');

Key Functions

Function Description
pgtle.install_extension() Install a new TLE extension
pgtle.install_update_path() Add an upgrade path between versions
pgtle.set_default_version() Set the default version for an extension
pgtle.uninstall_extension() Remove a TLE extension
pgtle.register_feature() Register a feature hook
pgtle.unregister_feature() Unregister a feature hook
pgtle.available_extensions() List available TLE extensions
pgtle.available_extension_versions() List available versions
Last updated on