{"id":6459,"date":"2015-12-07T14:24:56","date_gmt":"2015-12-07T13:24:56","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/"},"modified":"2015-12-07T14:24:56","modified_gmt":"2015-12-07T13:24:56","slug":"sql-monitoring-in-postgresql-3-pg_activity","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/","title":{"rendered":"SQL Monitoring in PostgreSQL (3) \u2013 pg_activity"},"content":{"rendered":"<p>The last posts looked at how the <a href=\"http:\/\/dbi-services.com\/blog\/sql-monitoring-in-postgresql-1-the-logging-system\/\" target=\"_blank\">logging system<\/a> and the <a href=\"http:\/\/dbi-services.com\/blog\/sql-monitoring-in-postgresql-2-pg_stat_statements\/\" target=\"_blank\">pg_stat_statements<\/a> extension can be used to monitor sql statements in PostgreSQL. This post will introduce <a href=\"https:\/\/github.com\/julmon\/pg_activity\/\" target=\"_blank\">pg_activity<\/a> which is very similar to <a href=\"http:\/\/hisham.hm\/htop\/\" target=\"_blank\">htop<\/a>. <\/p>\n<p>There are some dependencies which need to be installed before we can start installing pg_activity. The first one is python. As I am on a redhat based distribution this is quite easy:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\n[root@oel7 ~] yum install -y python\n<\/pre>\n<p>Then we need to install <a href=\"https:\/\/pypi.python.org\/pypi\/psycopg2\" target=\"_blank\">psycopg<\/a> which is the database adapter for PostgreSQL for the python language (Note: if you have installed PostgreSQL not in the default location edit the setup.cfg script and provide the path to pg_config. Otherwise the install will fail):<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@oel7:\/var\/tmp\/ [dummy] tar -axf psycopg2-2.6.1.tar.gz\npostgres@oel7:\/var\/tmp\/ [dummy] cd psycopg2-2.6.1\npostgres@oel7:\/var\/tmp\/psycopg2-2.6.1\/ [dummy] python setup.py build\npostgres@oel7:\/var\/tmp\/psycopg2-2.6.1\/ [dummy] sudo python setup.py install\n<\/pre>\n<p>The next (and last) thing we need to have available is <a href=\"https:\/\/pypi.python.org\/pypi\/psutil\" target=\"_blank\">psutils<\/a>, a python library for querying os statistics:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@oel7:\/var\/tmp\/ [dummy] tar -axf psutil-3.3.0.tar.gz\npostgres@oel7:\/var\/tmp\/ [dummy] cd psutil-3.3.0\npostgres@oel7:\/var\/tmp\/ [dummy] sudo python setup.py install\n<\/pre>\n<p>That&#8217;s it. Now we can install pg_activity:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@oel7:\/var\/tmp\/ [dummy] unzip pg_activity-master.zip\npostgres@oel7:\/var\/tmp\/ [dummy] cd pg_activity-master\npostgres@oel7:\/var\/tmp\/ [dummy] sudo python setup.py install\n<\/pre>\n<p>Quite easy. Lets see what we can do with it. If you are locally on the server where your PostgreSQL instance runs you can just start pg_activity (I fired a sql statement so that you can see at least one sql in the screenshot):<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@oel7:\/home\/postgres\/ [PG3] pg_activity\n<\/pre>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/pg_activity_11.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/pg_activity_11.png\" alt=\"pg_activity_1\" width=\"1212\" height=\"611\" class=\"aligncenter size-full wp-image-5838\" \/><\/a><\/p>\n<p>There is a nice summary on the top like in top\/htop. The different statements which are currently executing are displayed below.<\/p>\n<p>Hitting &#8220;h&#8221; for help shows you the various options:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/pg_activity_2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/pg_activity_2.png\" alt=\"pg_activity_2\" width=\"801\" height=\"574\" class=\"aligncenter size-full wp-image-5832\" \/><\/a><\/p>\n<p>The &#8220;F1\/2\/3&#8221; switches are very nice when you want to display blocking queries only, running queries only or waiting queries only. Another great features is that you do not need to install pg_activity on the server where PostgreSQL is running. The same connections options as in e.g. <a href=\"http:\/\/www.postgresql.org\/docs\/current\/static\/app-psql.html\" target=\"_blank\">psql<\/a> are there so that you can connect to any remote PostgreSQL instance you have access to:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@oel7:\/home\/postgres\/ [PG3] pg_activity --help\nUsage: pg_activity [options]\n\nhtop like application for PostgreSQL server activity monitoring.\n\nOptions:\n  --version             show program's version number and exit\n  -U USERNAME, --username=USERNAME\n                        Database user name (default: \"postgres\").\n  -p PORT, --port=PORT  Database server port (default: \"5432\").\n  -h HOSTNAME, --host=HOSTNAME\n                        Database server host or socket directory\n                        (default: \"localhost\").\n  -d DBNAME, --dbname=DBNAME\n                        Database name to connect to (default: \"postgres\").\n  -C, --no-color        Disable color usage.\n  --blocksize=BLOCKSIZE\n                        Filesystem blocksize (default: 4096)\n  --rds                 Enable support for AWS RDS\n  --help                Show this help message and exit.\n  --debug               Enable debug mode for traceback tracking.\n\n  Display Options, you can exclude some columns by using them :\n    --no-database       Disable DATABASE.\n    --no-user           Disable USER.\n    --no-client         Disable CLIENT.\n    --no-cpu            Disable CPU%.\n    --no-mem            Disable MEM%.\n    --no-read           Disable READ\/s.\n    --no-write          Disable WRITE\/s.\n    --no-time           Disable TIME+.\n    --no-wait           Disable W.\n<\/pre>\n<p>Conclusion: pg_activity is small but very useful tool for monitoring an PostgreSQL instance. In the next posts I&#8217;ll look into some more feature rich monitoring solutions that are around for monitoring PostgreSQL instances.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The last posts looked at how the logging system and the pg_stat_statements extension can be used to monitor sql statements in PostgreSQL. This post will introduce pg_activity which is very similar to htop. There are some dependencies which need to be installed before we can start installing pg_activity. The first one is python. As I&hellip;&nbsp;<\/p>\n","protected":false},"author":28,"featured_media":6462,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[4133],"tags":[143,98],"class_list":["post-6459","post","type-post","status-publish","format-standard","has-post-thumbnail","category-database","tag-monitoring","tag-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.9 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>SQL Monitoring in PostgreSQL (3) \u2013 pg_activity - dbi services Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Monitoring in PostgreSQL (3) \u2013 pg_activity\" \/>\n<meta property=\"og:description\" content=\"The last posts looked at how the logging system and the pg_stat_statements extension can be used to monitor sql statements in PostgreSQL. This post will introduce pg_activity which is very similar to htop. There are some dependencies which need to be installed before we can start installing pg_activity. The first one is python. As I&hellip;&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-07T13:24:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/pg_activity_1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"793\" \/>\n\t<meta property=\"og:image:height\" content=\"608\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Open source Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Open source Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/\"},\"author\":{\"name\":\"Open source Team\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/0b4548362cac3eeff8b3eaf329e3530a\"},\"headline\":\"SQL Monitoring in PostgreSQL (3) \u2013 pg_activity\",\"datePublished\":\"2015-12-07T13:24:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/\"},\"wordCount\":325,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/pg_activity_1.png\",\"keywords\":[\"Monitoring\",\"SQL\"],\"articleSection\":[\"Database\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/\",\"name\":\"SQL Monitoring in PostgreSQL (3) \u2013 pg_activity - dbi services Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/pg_activity_1.png\",\"datePublished\":\"2015-12-07T13:24:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/pg_activity_1.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/pg_activity_1.png\",\"width\":793,\"height\":608},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-monitoring-in-postgresql-3-pg_activity\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Monitoring in PostgreSQL (3) \u2013 pg_activity\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\",\"name\":\"dbi services\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/0b4548362cac3eeff8b3eaf329e3530a\",\"name\":\"Open source Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/open-source-author.png\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/open-source-author.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/open-source-author.png\",\"caption\":\"Open source Team\"},\"description\":\"Posts published under the Open source Team account are collective contributions by the dbi services open infrastructure consultants. The practice covers open-source databases and platforms, PostgreSQL first of all, along with MySQL, MariaDB, and Linux, from architecture, replication, and high availability to performance tuning and operations under service level agreements, and contributes actively to the PostgreSQL community.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/open-source-team\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL Monitoring in PostgreSQL (3) \u2013 pg_activity - dbi services Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/","og_locale":"en_US","og_type":"article","og_title":"SQL Monitoring in PostgreSQL (3) \u2013 pg_activity","og_description":"The last posts looked at how the logging system and the pg_stat_statements extension can be used to monitor sql statements in PostgreSQL. This post will introduce pg_activity which is very similar to htop. There are some dependencies which need to be installed before we can start installing pg_activity. The first one is python. As I&hellip;&nbsp;","og_url":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/","og_site_name":"dbi services Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2015-12-07T13:24:56+00:00","og_image":[{"width":793,"height":608,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/pg_activity_1.png","type":"image\/png"}],"author":"Open source Team","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","twitter_misc":{"Written by":"Open source Team","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/"},"author":{"name":"Open source Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0b4548362cac3eeff8b3eaf329e3530a"},"headline":"SQL Monitoring in PostgreSQL (3) \u2013 pg_activity","datePublished":"2015-12-07T13:24:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/"},"wordCount":325,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/pg_activity_1.png","keywords":["Monitoring","SQL"],"articleSection":["Database"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/","url":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/","name":"SQL Monitoring in PostgreSQL (3) \u2013 pg_activity - dbi services Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/pg_activity_1.png","datePublished":"2015-12-07T13:24:56+00:00","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/pg_activity_1.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/pg_activity_1.png","width":793,"height":608},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/sql-monitoring-in-postgresql-3-pg_activity\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL Monitoring in PostgreSQL (3) \u2013 pg_activity"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dbi-services.com\/#organization","name":"dbi services","url":"https:\/\/www.dbi-services.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0b4548362cac3eeff8b3eaf329e3530a","name":"Open source Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/05\/open-source-author.png","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/05\/open-source-author.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/05\/open-source-author.png","caption":"Open source Team"},"description":"Posts published under the Open source Team account are collective contributions by the dbi services open infrastructure consultants. The practice covers open-source databases and platforms, PostgreSQL first of all, along with MySQL, MariaDB, and Linux, from architecture, replication, and high availability to performance tuning and operations under service level agreements, and contributes actively to the PostgreSQL community.","url":"https:\/\/www.dbi-services.com\/blog\/author\/open-source-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/6459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=6459"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/6459\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/6462"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=6459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=6459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=6459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}