Example of creating extension with function for PostgreSQL.
If PostgreSQL is NOT installed:
- Clone this repository into PostgreSQL repository in contrib/ before compiling PostgreSQL. git clone https://github.com/EvdokimovIlia/my_first_extension <path_to_postgresql>/postgresql/contrib/
- Add in contrib/Makefile and contrib/Makefile_se the string with new directory to new extension
- Build PostgreSQL configure && make && sudo make install
- Log in postgresql and execute the command CREATE EXTENSION "my_first_extension".
If PostgreSQL is installed
- Clone this repository into PostgreSQL repository in contrib/ before compiling PostgreSQL. git clone https://github.com/EvdokimovIlia/my_first_extension <path_to_postgresql>/postgresql/contrib/
- Compile this directory
- Stop PostgreSQL if it's running sudo systemctl stop postgresql.service
- Add sql-file into postgresql/extension/ and copy so-file into lib/postgresql/
- Start PostgreSQL sudo systemctl start postgresql.service
- Log in postgresql and execute the command CREATE EXTENSION "my_first_extension".