PostgreSQL: Contrib Modules

Share via:

Contrib Modules:

In PostgreSQL, “contrib” stands for “contributed modules”. These are additional functionalities and features developed by the community that are not part of the core PostgreSQL distribution, but can be easily added to enhance the capabilities of the database.
Contributed modules are distributed separately and can be installed on top of PostgreSQL to provide extra functionalities. They cover a wide range of functionalities like data types, functions, operators, and procedural languages to full-fledged extensions that add new features to the database.
To use a contributed module, you typically need to follow these steps:
1 – Make sure the “contrib” package is installed: In some distributions, PostgreSQL may come with separate packages for “contrib extensions”.

Type “help” for help.

Which Means contrib modules are haven’t installed.
2 – Install contrib module:
• Move to the contrib directory

• Run below command

• Change the parameters in postgresql.conf file

In the postgresql.conf file, find the shared_preload_libraries parameter and add “pg_stat_statements” to it.
Shared_preload_libraries = ‘pg_stat_statements’
Now save and exit postgresql.conf file editor and restart the cluster by running below command:

3 – Enable the module: After Installing the “contrib” package, you need to enable the specific module you want to use. This is typically done by executing the ‘CREATE EXTENSION command. For example, to enable the “pg_stat_statements” extension, you would run:

4 – Ensure the extension is installed:
To check if it’s installed, you can run the following SQL command

Here are commands to check the list of installed extensions:

Droping an extension:
To drop an extension in PostgreSQL, you can use the DROP EXTENSION command. Here’s how to drop pg_stat_statements extension:

 

Author    : Prudhvi Teja
LinkedIn  : http://linkedin.com/in/prudhvi-teja-nagabhyru-715052224
Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates
KTExperts is always active on social media platforms.
Facebook  : https://www.facebook.com/ktexperts/
LinkedIn    : https://www.linkedin.com/company/ktexperts/
Twitter       : https://twitter.com/ktexpertsadmin
YouTube   :  https://www.youtube.com/c/ktexperts
Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Add Comment