Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wPWiG-000nEY-1P for pgsql-announce@arkaria.postgresql.org; Wed, 20 May 2026 02:31:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wPWiE-005pkJ-0a for pgsql-announce@arkaria.postgresql.org; Wed, 20 May 2026 02:31:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wPWiD-005pk5-1H for pgsql-announce@lists.postgresql.org; Wed, 20 May 2026 02:31:10 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wPWiA-00000000TVb-2lNg for pgsql-announce@lists.postgresql.org; Wed, 20 May 2026 02:31:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:From:To:Subject: MIME-Version:Content-Type:Sender:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=KZm8MOy03gtxbg682glT4j2oGvyvKqcv5K5TUDs5uKw=; b=uu0RGYtQAniqjvNADVPMNSL0dU jwCMcIiM3FAmzhP7hMWVceSFE2RuZdXpZ6wksdFm4AnblnlmB0+5647VRNeMt558YyYWOp40UWWmo OvD1md/swWerEj5sH9yXTNBIpbiRPZXIFZ7LVSF6j+JLgidPaJUiX3i0T2/s7KHGmWDeeZCzXulHD 0dzPaYE9kcdEPTQhrAYM6+lWLoSwNcVxxEMJDjJQGdiTSg8uhcndvsKGOXT9gRuUk9/l4RuuCrDRx 31obq+1uK+zm4R51txC0eXzz4ifFiVdW9goYCN2Sb0GYIoIuZE/FW/OXlGkI8nhYOn1sJnIhuCXYM V0fws72Q==; Received: from wrigleys.postgresql.org ([217.196.149.60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wPWi7-001G2M-2d for pgsql-announce@lists.postgresql.org; Wed, 20 May 2026 02:31:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wPWi7-002W1I-2W for pgsql-announce@lists.postgresql.org; Wed, 20 May 2026 02:31:03 +0000 Content-Type: multipart/alternative; boundary="===============1165545101973956704==" MIME-Version: 1.0 Subject: plpgsql_wrap v1.0 released To: PostgreSQL Announce From: HexaCluster via PostgreSQL Announce Reply-To: gilles@hexacluster.ai Date: Wed, 20 May 2026 02:30:08 +0000 Message-ID: <177924420810.800.9900559501732599882@wrigleys.postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-pglister-tags: related X-pglister-tagsig: c93a6448b5d3af19753b6c1d699ccc7dd48bfb2b577ef3936ca861856d65d8f7 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --===============1165545101973956704== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Toronto, Canada - May 19th, 2026 ## PostgreSQL plpgsql wrap utility `plpgsql_wrap` is a PostgreSQL extension used to obfuscate PLPGSQL source c= ode, making it unreadable to users while remaining fully executable by the = PostgreSQL database. It is primarily used to protect intellectual property = or sensitive business logic when delivering code to third parties. It is si= milar to the Oracle WRAP function and utility. plpgsql_wrap v1.0 has been released, this is the first public release. It i= s compatible with PostgreSQL versions >=3D 12. Write stored procedures with `LANGUAGE plpgsql_wrap;` source is validated, = then AES-256-GCM encrypted directly into `pg_proc.prosrc`.=20 Users cannot look at store procedures plain text source code any more unles= s they know the encryption key. pg_dump will not expose store procedures plain text source code too and the= pg_dump output is directly restorable. Pre-wrapped blobs are accepted at C= REATE time. It is identical to `LANGUAGE plpgsql`, only the language name differs: `plp= gsql_wrap`. Example of use: CREATE OR REPLACE FUNCTION public.calculate_bonus(emp_id int, yr int) RETURNS numeric LANGUAGE plpgsql_wrap AS $$ DECLARE v_salary numeric; BEGIN SELECT salary INTO v_salary FROM employees WHERE id =3D emp_id; RETURN v_salary * 0.15; -- confidential formula END; $$; -- Calling, permissions, overloading, results - all identical to plpgsql: SELECT calculate_bonus(42, 2024); In catalog table `pg_proc` the code is obfuscated: SELECT substring(prosrc, 1, 50)||'...' AS wrapped_code FROM pg_proc WHERE proname =3D 'calculate_bonus'; wrapped_code =20 ------------------------------------------------------- PLPGSQLWRAP:1:5752415001f5db365c6c185b66081ff0a23d... (1 line) This is also what will appears in the pg_dump output. The `plpgsql_wrap.unwrap_procedure()` function is provided to recover the p= lain text source code using the encryption key. See detailed information by= reading the [documentation](https://github.com/hexacluster/plpgsql_wrap/) ## Links & Credits plpgsql_wrap is an open project. Any contribution to build a better tool is welcome. You just have to send your ideas, features requests or patches using the GitHub tools. **Links :** * Documentation: [https://github.com/hexacluster/plpgsql_wrap/](https://gi= thub.com/hexacluster/plpgsql_wrap/) * Download: [https://github.com/hexacluster/plpgsql_wrap/releases/](https:= //github.com/hexacluster/plpgsql_wrap/releases/) * Community support: use GitHub report tool at [https://github.com/hexaclu= ster/plpgsql_wrap/issues](https://github.com/hexacluster/plpgsql_wrap/issue= s) * Commercial support: [contact Hexacluster](https://hexacluster.ai/contact= -us) ## About plpgsql_wrap The objective of this extension it to provide a feature to obfuscate plpgsq= l source code. It is primarily used to protect intellectual property or sen= sitive business logic when delivering code. This is a project created and maintained by Gilles Darold at [HexaCluster C= orp](https://hexacluster.ai). --===============1165545101973956704== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable plpgsql_wrap v1.0 released
 

plpgsql_wrap v1.0 released

Toronto, Canada - May 19th, 2026

PostgreSQL plpgsql wrap utility=

plpgsql_wrap is a PostgreSQL e= xtension used to obfuscate PLPGSQL source code, making it unreadable to use= rs while remaining fully executable by the PostgreSQL database. It is prima= rily used to protect intellectual property or sensitive business logic when= delivering code to third parties. It is similar to the Oracle WRAP functio= n and utility.

plpgsql_wrap v1.0 has been released, this i= s the first public release. It is compatible with PostgreSQL versions >= =3D 12.

Write stored procedures with LANGUAGE= plpgsql_wrap; source is validated, then AES-256-GCM encrypted direc= tly into pg_proc.prosrc.

Users cannot look at store procedures plain= text source code any more unless they know the encryption key.

pg_dump will not expose store procedures pl= ain text source code too and the pg_dump output is directly restorable. Pre= -wrapped blobs are accepted at CREATE time.

It is identical to LANGUAGE plpgsql, only the language name differs: plpgsql_wrap.

Example of use:

CREATE OR REPLACE FUNCTION public.calculate_bonus(emp_id int, yr=
 int)
RETURNS numeric
LANGUAGE plpgsql_wrap
AS $$
DECLARE
    v_salary numeric;
BEGIN
    SELECT salary INTO v_salary FROM employees WHERE id =3D emp_id;
    RETURN v_salary * 0.15;   -- confidential formula
END;
$$;

-- Calling, permissions, overloading, results - all identical to plpgsql:
SELECT calculate_bonus(42, 2024);

In catalog table pg_proc the c= ode is obfuscated:

SELECT substring(prosrc, 1, 50)||'...' AS wrapped_code
    FROM pg_proc WHERE proname =3D 'calculate_bonus';
             wrapped_code                     =20
-------------------------------------------------------
 PLPGSQLWRAP:1:5752415001f5db365c6c185b66081ff0a23d...
(1 line)

This is also what will appears in the pg_du= mp output.

The plpgsql_wrap.unwrap_procedure() function is provided to recover the plain text source code using the = encryption key. See detailed information by reading the documentation

Links & Credits

plpgsql_wrap is an open project. Any contri= bution to build a better tool is welcome. You just have to send your ideas, features requests or patches using the GitHub tools.

Links :

About plpgsql_wrap

The objective of this extension it to provi= de a feature to obfuscate plpgsql source code. It is primarily used to prot= ect intellectual property or sensitive business logic when delivering code.=

This is a project created and maintained by= Gilles Darold at HexaCluster Corp.

This email was sent to you from HexaCluster. It was delivered on their beha= lf by the PostgreSQL project. Any questions about the content of the message shou= ld be sent to HexaCluster.

You were sent this email as a subscriber of the pgsql-announce mai= linglist, for the content tag Related Open Source. To unsubscribe from further emails, or change which emails you want to receive, please click th= e personal unsubscribe link that you can find in the headers of this email, or visit https://lists.postgresql.org/unsubscribe/.
 
--===============1165545101973956704==--