A PostgreSQL extension using PL/Python3U to add numbers
pg_py_ext is a simple PostgreSQL extension that demonstrates how to create a function using the PL/Python3U language to add two numbers.
-
Ensure you have PostgreSQL installed on your system.
-
Clone or download the repository pg_py_ext to your local machine.
-
Change to the extension directory:
$ cd pg_py_ext
To build and install the extension, follow these steps:
$ make
$ sudo make install
This will compile the extension and install it into your PostgreSQL installation.
After the extension is installed, you can use the add_numbers
function to add two numbers using PL/Python3U.
-- Load the extension
CREATE EXTENSION pg_py_ext;
-- Use the add_numbers function
SELECT add_numbers(5, 3); -- Returns 8
To uninstall the extension, you can run the following SQL command:
DROP EXTENSION pg_py_ext;
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository pg_py_ext.
This project is licensed under the PostgreSQL License.