{"id":282,"date":"2008-05-30T08:21:00","date_gmt":"2008-05-30T08:21:00","guid":{"rendered":"http:\/\/new.cottee.org\/2008\/05\/pg_top-on-ubuntu-hardy-postgres-top-utility\/"},"modified":"2008-05-30T08:21:00","modified_gmt":"2008-05-30T08:21:00","slug":"pg_top-on-ubuntu-hardy-postgres-top-utility","status":"publish","type":"post","link":"https:\/\/cottee.org\/?p=282","title":{"rendered":">pg_top on Ubuntu Hardy &#8211; Postgres top utility"},"content":{"rendered":"<p>>This morning I got <a href=\"http:\/\/search.cpan.org\/~cosimo\/pgtop-0.04\/pgtop\">pgtop<\/a> working but had some questions which I forwarded to the author Cosimo Streppone. In his very polite reply he pointed out I should really be using <a href=\"http:\/\/ptop.projects.postgresql.org\/\">pg_top<\/a> (note the hyphen) so I then set to getting that to work on Ubuntu Hardy Heron.<\/p>\n<p>Download the latest release from the site above (I downloaded pg_top-3.6.2.tar.gz) and then<\/p>\n<pre><br \/>tar -zxpvf pg_top-3.6.2.tar.gz <br \/>cd pg_top-3.6.2<br \/>.\/configure <br \/>make<br \/><\/pre>\n<p>It&#8217;s very possible you might get some errors during this. The three I had were<\/p>\n<pre>configure: error: no acceptable C compiler found in $PATH<\/pre>\n<p>You don&#8217;t have the basic build tools installed. Do. <\/p>\n<pre>sudo apt-get install build-essential<\/pre>\n<p>Also during config <\/p>\n<pre>configure: error: pg_config not found<\/pre>\n<p>Get the postgres dev libs &#8211; do<\/p>\n<pre>sudo apt-get install libpq-dev<\/pre>\n<p>During make I got a heap of errors &#8211; starting with <\/p>\n<pre>gcc  -Wall -g -L\/usr\/lib -lpq  -o pg_top color.o commands.o display.o getopt.o screen.o sprompt.o pg.o pg_top.o username.o utils.o version.o m_linux.o -ldl -lm <br \/>display.o: In function `display_move':<br \/>\/home\/icottee\/pg_top-3.6.2\/display.c:257: undefined reference to `tgoto'<br \/>\/home\/icottee\/pg_top-3.6.2\/display.c:257: undefined reference to `tputs'<br \/>display.o: In function `display_write':<br \/>\/home\/icottee\/pg_top-3.6.2\/display.c:387: undefined reference to `tgoto'<br \/>\/home\/icottee\/pg_top-3.6.2\/display.c:387: undefined reference to `tputs'<\/pre>\n<p>The solution I found was to <\/p>\n<pre>sudo apt-get install libncurses5-dev<\/pre>\n<p>Then rerun config AGAIN and do a make. <\/p>\n<p>Now I could <\/p>\n<pre>pg_top --help<\/pre>\n<p>And all was good. Read the web page for info about what you can do with it. But in short you can see all running postgres processes, see what they are doing, examine their query plan, what locks they have and examine table and index statistics of the relevant tables. Full info and screenshots can be found <a href=\"http:\/\/ptop.projects.postgresql.org\/screenshots\/\">here<\/a>. <\/p>\n<div class=\"blogger-post-footer\"><img width='1' height='1' src='https:\/\/blogger.googleusercontent.com\/tracker\/9210244490645736884-1036005356437292219?l=blog.cottee.org' alt='' \/><\/div>\n","protected":false},"excerpt":{"rendered":"<p>>This morning I got pgtop working but had some questions which I forwarded to the author Cosimo Streppone. In his very polite reply he pointed out I should really be using pg_top (note the hyphen) so I then set to getting that to work on Ubuntu Hardy Heron. Download the latest release from the site above (I downloaded pg_top-3.6.2.tar.gz) and then tar -zxpvf pg_top-3.6.2.tar.gz cd pg_top-3.6.2.\/configure make It&#8217;s very possible you might get some errors during this. The three I&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/cottee.org\/?p=282\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[25,40,47],"class_list":["post-282","post","type-post","status-publish","format-standard","hentry","category-oldsite","tag-hardy","tag-postgres","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/cottee.org\/index.php?rest_route=\/wp\/v2\/posts\/282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cottee.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cottee.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cottee.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cottee.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=282"}],"version-history":[{"count":0,"href":"https:\/\/cottee.org\/index.php?rest_route=\/wp\/v2\/posts\/282\/revisions"}],"wp:attachment":[{"href":"https:\/\/cottee.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cottee.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cottee.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}