PostgreSQL introduces another way to install contrib module, called extensions. If any contrib module build with the extension specification which includes:
- The Extension SQL file (extension_name.sql)
- The Extension control file (extension_name.control)
- The Extensions library file (extension_name.so)
Let's look at the following commands:
- CREATE EXTENSION extension_name: This command will install a new extension called dummy, so there will be no need to manually execute a sql file like we did while installing pg_buffercache.
- ALTER EXTENSION extension name: This command will alter the extension and is mostly used to upgrade an extension.
- DROP EXTENIONS extension_name: This command deletes a extension, after this clean-up is done.