pg_sample_ext is a PostgreSQL extension that provides a sample function to demonstrate extending PostgreSQL's functionality. The extension includes a custom function to calculate the square of a number.
Make sure you have PostgreSQL installed and running.
Clone or download the repository pg_sample_ext to your local machine.
Change to the extension directory:
$ cd pg_sample_ext
Build and install the extension:
$ make $ make install
Connect to your PostgreSQL database as a superuser.
Enable the extension:
CREATE EXTENSION pg_sample_ext;
pg_sample_ext extension is installed and enabled, you can use the included functions in your SQL queries.
square function calculates the square of a number.
SELECT square(5); -- Returns 25
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on GitHub repository pg_sample_ext.
This project is licensed under the PostgreSQL License.