As pgMemento is written entirely in SQL and PL/pgSQL it's sufficient to run all scripts from the `src` folder to install it. A new schema will appear in your database called `pgmemento`. The provided `INSTALL_PGMEMENTO.sql` script also adds the schema to your database's `search_path`. `psql -h localhost -p 5432 -U my_user -d my_database -f INSTALL_PGMEMENTO.sql` The script should end with the message "pgMemento setup completed!". ## Build as extension Since v0.7 pgMemento can also be installed as an extension into your databases. But first, you have to build the extension. To do so, open a shell environment and change to the `extension/pgxn` directory. Make the `build.sh` script executable with `chmod +x` and run it. The output should look like this: ``` Copying the control file ... done Preparing the filesystem structure ... done Compiling the extension SQL ... done Copying the documentation ... done Building the archive ... adding: pgmemento-0.7/ adding: pgmemento-0.7/README.pgmemento adding: pgmemento-0.7/META.json adding: pgmemento-0.7/LICENSE.pgmemento adding: pgmemento-0.7/Makefile adding: pgmemento-0.7/sql/ adding: pgmemento-0.7/sql/pgmemento.sql adding: pgmemento-0.7/test/ adding: pgmemento-0.7/doc/ adding: pgmemento-0.7/doc/pgmemento-docs-0.7/ adding: pgmemento-0.7/doc/pgmemento-docs-0.7/... (all doc files) adding: pgmemento-0.7/pgmemento.control done ``` pgMemento is now bundled in a zip file within the newly created `dist` directory within the same folder. ## Install the extension Change to the `dist` folder and unzip the archive. Change to the unpacked `pgmemento-0.7` directory and run: `make && sudo make install` pgMemento should now be installed in your PostgreSQL. You can connect to any DB and check the `pg_available_extensions` system view: `SELECT * FROM pg_available_extensions WHERE name = 'pgmemento';` If pgMemento is listed there you are now able to run: `CREATE EXTENSION pgmemento;` ## Check the pgMemento version To check which version of pgMemento you have just installed run the following command: ```sql SELECT full_version, build_id FROM pgmemento.version(); full_version | build_id -----------------+---------- pgMemento 0.7.0 | 60 ``` `build_id` refers to the pull request number, to make it easy to track which changes are included. It might change in the future to the commit hash.