Trusted Language Extensions for PostgreSQL (pg_tle)
Trusted Language Extensions for PostgreSQL, commonly known as pg_tle
, is an innovative open source project aimed at developers who wish to extend PostgreSQL capabilities with minimal hassle. This project allows users to create and deploy new functionalities in PostgreSQL without the significant technical obstacles often involved with such processes. Through pg_tle
, developers can craft and install extensions even on systems with restricted file access, leveraging a SQL API to interact with PostgreSQL's internals.
Overview
PostgreSQL's extension framework is a robust mechanism that enables developers to introduce new functionalities without altering the core codebase. This framework is versatile, supporting the development of new data types, integration with other database systems, and more. It also aids in collecting functionally related code into a coherent unit, which can be versioned with ease for efficient distribution across various PostgreSQL databases.
However, many database environments, particularly those involving managed service providers or containerized systems, limit filesystem access for reasons of security and stability. This restriction can hinder the installation of new extensions, requiring requests to service providers or the rebuilding of container images.
pg_tle
addresses this challenge by enabling developers to manage and install extensions in such restrictive environments. PostgreSQL offers "trusted languages"—development languages that include security measures like restricted direct filesystem access and networking properties. With these security features, database administrators can permit users to write stored procedures in languages such as PL/pgSQL, JavaScript, or Perl. Furthermore, PostgreSQL allows marking certain extensions as "trusted," meaning users, even without advanced privileges, can install and use these extensions without risking system security.
Getting started
To initialize pg_tle
, developers should follow the detailed installation instructions. After installing pg_tle
, beginners can dive into creating their first Trusted Language Extension by using the quickstart guide.
The project documentation also offers comprehensive guidance on managing pg_tle
through its extension management API and information on accessible hooks. Additionally, there are practical examples for writing Trusted Language Extensions in various programming languages, including:
Help & Feedback
For questions or feature requests, pg_tle
recommends starting with the project documentation. If more information is needed, users can search existing issues or open a new issue for assistance.
Contributing
The pg_tle
project encourages contributions from the community. Interested contributors can consult the contribution guide for instructions on reporting issues, setting up a development environment, and submitting code. It's also beneficial for contributors to familiarize themselves with the architecture guide to grasp the design principles underlying pg_tle
. The project follows the Amazon Open Source Code of Conduct.
Security
For more information on security issues, refer to the CONTRIBUTING section.
License
The pg_tle
project is licensed under the Apache-2.0 License, ensuring it is open source and freely available for developers to use and modify.