In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to install extension package for PostgreSQL". In daily operation, I believe many people have doubts about how to install extension package for PostgreSQL. Xiaobian consulted all kinds of information and sorted out simple and easy operation methods. I hope to help you answer the doubts of "how to install extension package for PostgreSQL"! Next, please follow the small series to learn together!
I. Background:
Because the patrol needs to collect PostgreSQL state information, extension pg_stat_statements is usually called; this module provides execution statistics of all SQL statements executed by the trace server, which can be used to count the resource cost of the database and analyze TOP SQL. And the module provides a view pg_stat_statements and functions pg_stat_statements_reset and pg_stat_statements for accessing and manipulating these statistics.
II. Conditions:
2.1 PostgreSQL installation if it is a source installation, and the installation package needs to exist.
2.2 PostgreSQL installation If it is a Yum or RPM installation, the server must be able to access the corresponding Yum source.
Third, check whether the extension package has compiled
[root@open_source ~]# ll /usr/pgsql-10/share/extension/total 1044[root@open_source extension]# ll pg_stat_statements*-rw-r--r-- 1 root root 1246 Jul 13 08:18 pg_stat_statements--1.0--1.1.sql-rw-r--r-- 1 root root 1336 Jul 13 08:18 pg_stat_statements--1.1--1.2.sql-rw-r--r-- 1 root root 1454 Jul 13 08:18 pg_stat_statements--1.2--1.3.sql-rw-r--r-- 1 root root 345 Jul 13 08:18 pg_stat_statements--1.3--1.4.sql-rw-r--r-- 1 root root 305 Jul 13 08:18 pg_stat_statements--1.4--1.5.sql-rw-r--r-- 1 root root 1427 Jul 13 08:18 pg_stat_statements--1.4.sql-rw-r--r-- 1 root root 376 Jul 13 08:18 pg_stat_statements--1.5--1.6.sql-rw-r--r-- 1 root root 191 Jul 13 08:18 pg_stat_statements.control-rw-r--r-- 1 root root 449 Jul 13 08:18 pg_stat_statements--unpackaged--1.0.sql
IV. Loading the extension package
postgres=# \dx List of installed extensions Name | Version | Schema | Description ---------+---------+------------+------------------------------ plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language(1 row)postgres=# create extension pg_stat_statements;CREATE EXTENSIONpostgres=# \dx List of installed extensions Name | Version | Schema | Description --------------------+---------+------------+----------------------------------------------------------- pg_stat_statements | 1.5 | public | track execution statistics of all SQL statements executed plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language(2 rows)
V. Execute the patrol script and successfully invoke the extension package content
sh pgsql_check_script.sh > 20200713_report_10.2.109.11.txt 2>&1
Remarks:
1. Source code compilation options:
./ configure --prefix= prefix using yum installation location
Then execute make to generate contrib, which requires the header file related to make
2, remember: do not need to execute make install after executing make, otherwise it will overwrite the original related files and then cd contrib directory to execute make && make install can install pg native extension
At this point, the study of "how to install extension packages for PostgreSQL" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.