How to use a Binary Search Key
Understanding how Binary Search Key works? A binary search key is used to quickly search for a specific value in a sorted array or list. The basic idea behind the binary search algorithm is to […]
Understanding how Binary Search Key works? A binary search key is used to quickly search for a specific value in a sorted array or list. The basic idea behind the binary search algorithm is to […]
PostGIS for dummies – How PostGIS works? PostGIS is an open-source extension for the PostgreSQL database management system that adds spatial functionality for working with geographic data. It allows you to store, index, and query […]
PostgreSQL Advanced DBA Series: Monitoring PostgreSQL replication lag There are several ways to monitor replication lag in PostgreSQL: pg_stat_replication: This is a PostgreSQL system view that provides information about the replication status, including the replication lag. […]
PostgreSQL 15 Advanced DBA Series: Troubleshooting PostgreSQL 15 replication lag with IO concurrency There are several ways to reduce replication lag with IO concurrency in PostgreSQL 15: Increase the number of parallel workers: PostgreSQL 15 […]
PostgreSQL 15 new features PostgreSQL 15, the latest version of the popular open-source relational database management system, was released on October 3rd, 2021 and it comes with several new features and improvements: Parallelized Vacuum: PostgreSQL […]
How to stop PostgreSQL in an emergency? Sometimes DBAs need to stop PostgreSQL Server on an emergency notice. In such situations, DBAs cannot even wait for client connections to close gracefully, This post is for […]
Drop and Recreate PG_STAT_STATEMENTS in PostgreSQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
/* First we have to remove them from the extension */ ALTER EXTENSION pg_stat_statements DROP VIEW pg_stat_statements; ALTER EXTENSION pg_stat_statements DROP FUNCTION pg_stat_statements(boolean); /* Then we can drop them */ DROP VIEW pg_stat_statements; DROP FUNCTION pg_stat_statements(boolean); /* Now redefine */ CREATE FUNCTION pg_stat_statements(IN showtext boolean, OUT userid oid, OUT dbid oid, OUT queryid bigint, OUT query text, OUT calls int8, OUT total_time float8, OUT min_time float8, OUT max_time float8, OUT mean_time float8, OUT stddev_time float8, OUT rows int8, OUT shared_blks_hit int8, OUT shared_blks_read int8, OUT shared_blks_dirtied int8, OUT shared_blks_written int8, OUT local_blks_hit int8, OUT local_blks_read int8, OUT local_blks_dirtied int8, OUT local_blks_written int8, OUT temp_blks_read int8, OUT temp_blks_written int8, OUT blk_read_time float8, OUT blk_write_time float8 ) RETURNS SETOF record AS 'MODULE_PATHNAME', 'pg_stat_statements_1_3' LANGUAGE C STRICT VOLATILE; CREATE VIEW pg_stat_statements AS SELECT * FROM pg_stat_statements(true); GRANT SELECT ON pg_stat_statements TO PUBLIC; |
How to disable SELinux? Step 1: Open the SELinux configuration file: /etc/selinux/config. Step 2: Locate the following line:
1 |
SELINUX=enforcing |
Step 3: Change the value to disabled:
1 |
SELINUX=disabled |
Step 4: Save your changes and close the […]
PostgreSQL Background Worker Processes PostgreSQL can be extended to run user-supplied code in separate processes. Such processes are started, stopped and monitored by postgres, which permits them to have a lifetime closely linked to the […]
MySQL and SE Linux Security-Enhanced Linux (SELinux) is a mandatory access control (MAC) system that implements access rights by applying a security label referred to as an SELinux context to each system object. SELinux policy […]
MySQL, InnoDB and Oracle are registered trademarks of Oracle Corp. MariaDB is a trademark of Monty Program AB. All other trademarks are property of their respective owners. Other product or company names mentioned may be trademarks or trade names of their respective owner. Copyrights © 2010-2024. All Rights Reserved by MinervaDB®.