{"id":1741,"date":"2016-08-26T17:15:35","date_gmt":"2016-08-26T14:15:35","guid":{"rendered":"http:\/\/www.systemcodegeeks.com\/?p=1741"},"modified":"2017-12-04T16:05:19","modified_gmt":"2017-12-04T14:05:19","slug":"postgresql-vacuum","status":"publish","type":"post","link":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/","title":{"rendered":"PostgreSQL VACUUM Command Example"},"content":{"rendered":"<p><em>This article is part of our Academy Course titled <a href=\"http:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-database-tutorial\/\">PostgreSQL Database Tutorial<\/a>.<\/p>\n<p>In this course, we provide a compilation of PostgreSQL tutorials that will help you set up and run your own database management system. We cover a wide range of topics, from installation and configuration, to custom commands and datatypes. With our straightforward tutorials, you will be able to get your own projects up and running in minimum time. Check it out <a href=\"http:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-database-tutorial\/\">here<\/a>!<\/em><\/p>\n<p>In the previous tutorials of this series (\u201c<a href=\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-introduction-installation\/\" target=\"_blank\">PostgreSQL: Introduction and installation<\/a>\u201d and \u201c<a href=\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/\" target=\"_blank\">PostgreSQL commands and datatypes<\/a>\u201d) we explained how to load a sample database (World_db) into our PostgreSQL server and how to get help with both SQL and psql commands.<\/p>\n<p>In real-world scenarios, you will need to perform <strong>CRUD<\/strong> (<strong>C<\/strong>reate, <strong>R<\/strong>ead, <strong>U<\/strong>pdate, and <strong>D<\/strong>elete) operations on database tables all the time. In this post we will learn how to do U (updates) and D (deletes), and show how to clean up the database by removing the left overs resulting from these operations. As we will see in a moment, PostgreSQL provides an effective garbage collector for this.<\/p>\n<p>Without going into the nitty-gritty of what happens under the hood, we can mention briefly that the previous versions of updated records or deleted table entries are not actually removed from the database. Think about the need to rollback a given transaction and this will make sense. They are just \u201cnot visible\u201d anymore by regular means, and they keep contributing to the amount of used hard disk space until a clean-up is performed using the <strong>VACUUM<\/strong> psql command. Let\u2019s take a look at it in greater detail later.<br \/>\n[ulp id=&#8217;mezv5fambxsNcQw8&#8242;]<\/p>\n<h2>Updating and removing rows<\/h2>\n<p>Using the World_db database, let\u2019s update by 7% the population of all cities in the city table. Before we do that, let\u2019s take a look at the impact this operation would have on the current data by using a basic SELECT statement.<\/p>\n<div class=\"tip\">Before a mass update or removal, using SELECT to print the records that will be impacted by that operation is a wise thing to do. Among other things, this can help you prevent undesired results (and the associated later regret), especially if you forget to add a WHERE clause to the operation.<\/div>\n<p>We will print the city name, its current population, and the population after our proposed update. To round the population increase to the nearest integer, we will use the <a href=\"https:\/\/www.postgresql.org\/docs\/9.5\/static\/functions-math.html#FUNCTIONS-MATH-FUNC-TABLE\">ROUND<\/a> function as shown in Fig. 1:<\/p>\n<figure id=\"attachment_1742\" aria-describedby=\"caption-attachment-1742\" style=\"width: 659px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/01postgresql3.png\"><img decoding=\"async\" class=\"size-full wp-image-1742\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/01postgresql3.png\" alt=\"Displaying the results of a preliminar SQL query before updating\" width=\"659\" height=\"278\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/01postgresql3.png 659w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/01postgresql3-300x127.png 300w\" sizes=\"(max-width: 659px) 100vw, 659px\" \/><\/a><figcaption id=\"caption-attachment-1742\" class=\"wp-caption-text\">Figure 1 &#8211; Displaying the results of a preliminar SQL query before updating<\/figcaption><\/figure>\n<pre class=\"brush:bash\">SELECT name AS \"Name\", population AS \"Current population\", ROUND(population * 1.07) \u00a0AS \"New population\" FROM city ORDER BY name;<\/pre>\n<div class=\"tip\">With the AS keyword you can create an alias for the associated field so that the results of the query will use it as header. As you can see in Fig. 1, we renamed name and population to <b>Name <\/b>and <b>Current population<\/b>, respectively. In addition, we named the results of the mathematical operation as <b>New population<\/b>.<\/div>\n<p>Now let\u2019s do the actual update. In this case we will not use a WHERE clause as we actually want to update all cities. This will result in the population update of all 4079 cities currently present in the city table, as we can see in Fig. 2:<\/p>\n<figure id=\"attachment_1745\" aria-describedby=\"caption-attachment-1745\" style=\"width: 599px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/02postgresql3.png\"><img decoding=\"async\" class=\"size-full wp-image-1745\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/02postgresql3.png\" alt=\"Updating the city table\" width=\"599\" height=\"174\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/02postgresql3.png 599w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/02postgresql3-300x87.png 300w\" sizes=\"(max-width: 599px) 100vw, 599px\" \/><\/a><figcaption id=\"caption-attachment-1745\" class=\"wp-caption-text\">Figure 2 &#8211; Updating the city table<\/figcaption><\/figure>\n<pre class=\"brush:bash\">UPDATE city SET population = ROUND(population * 1.07);<\/pre>\n<p>Now let\u2019s delete all Australian cities where the Id is greater than 135 (this will exclude Canberra, the capital, which is referenced in the country table). As before, use a SELECT first to examine the records that will be deleted:<\/p>\n<pre class=\"brush:bash\">SELECT name FROM city WHERE countrycode='AUS';<\/pre>\n<p>If you\u2019re OK with it, then proceed with the DELETE operation:<\/p>\n<pre class=\"brush:bash\">DELETE FROM city WHERE Id BETWEEN 136 AND 143;<\/pre>\n<p>Refer to Fig. 3 for details:<\/p>\n<figure id=\"attachment_1746\" aria-describedby=\"caption-attachment-1746\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/03postgresql3.png\"><img decoding=\"async\" class=\"size-full wp-image-1746\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/03postgresql3.png\" alt=\"Selecting records before deleting them\" width=\"575\" height=\"420\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/03postgresql3.png 575w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/03postgresql3-300x219.png 300w\" sizes=\"(max-width: 575px) 100vw, 575px\" \/><\/a><figcaption id=\"caption-attachment-1746\" class=\"wp-caption-text\">Figure 3 &#8211; Selecting records before deleting them<\/figcaption><\/figure>\n<p>On tables that are heavily updated or where removals are performed constantly, this will translate into a lot of wasted disk space. Keep in mind that when you perform an update on a table or remove a record, the original is kept in the database.<\/p>\n<h2>Introducing VACUUM<\/h2>\n<p>To formally introduce VACUUM, let\u2019s use what we learned in <a href=\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-commands-datatypes\/\" target=\"_blank\">PostgreSQL commands and data types<\/a> to display the help about this command (see Fig. 4):<\/p>\n<figure id=\"attachment_1747\" aria-describedby=\"caption-attachment-1747\" style=\"width: 671px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/04postgresql3.png\"><img decoding=\"async\" class=\"size-full wp-image-1747\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/04postgresql3.png\" alt=\"Figure 4 - Displaying help about VACUUM\" width=\"671\" height=\"175\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/04postgresql3.png 671w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/04postgresql3-300x78.png 300w\" sizes=\"(max-width: 671px) 100vw, 671px\" \/><\/a><figcaption id=\"caption-attachment-1747\" class=\"wp-caption-text\">Figure 4 &#8211; Displaying help about VACUUM<\/figcaption><\/figure>\n<pre class=\"brush:bash\">\\h VACUUM;<\/pre>\n<div class=\"tip\">All of the below commands can be applied to the entire database (no arguments) or a single table (name the table at the end of the command).<\/div>\n<p>To collect the garbage present in the database, just do<\/p>\n<pre class=\"brush:bash\">VACUUM;<\/pre>\n<p>However, that will not free up the space used by the old records back to the operating system &#8211; it will only clean up the old records and then make the space available to be reused by the same table. On the other hand,<\/p>\n<pre class=\"brush:bash\">VACUUM FULL;<\/pre>\n<p>will ensure that whatever space is freed up will be returned to the operating system.<\/p>\n<p>Additionally,<\/p>\n<pre class=\"brush:bash\">VACUUM FULL VERBOSE;<\/pre>\n<p>will also display messages about what\u2019s going on.<\/p>\n<p>That said, let\u2019s perform a full, verbose vacuum on the city table (refer to Fig. 5 for details):<\/p>\n<figure id=\"attachment_1748\" aria-describedby=\"caption-attachment-1748\" style=\"width: 693px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/05postgresql3.png\"><img decoding=\"async\" class=\"size-full wp-image-1748\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/05postgresql3.png\" alt=\"Performing a FULL, VERBOSE VACUUM\" width=\"693\" height=\"137\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/05postgresql3.png 693w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/08\/05postgresql3-300x59.png 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/a><figcaption id=\"caption-attachment-1748\" class=\"wp-caption-text\">Figure 5 &#8211; Performing a FULL, VERBOSE VACUUM<\/figcaption><\/figure>\n<pre class=\"brush:bash\">VACUUM FULL VERBOSE city;<\/pre>\n<p>As you can see above, VACUUM located and removed the space left behind by the deletion of the 8 records from the city table earlier. On large scale updates and removals, this will translate into considerable space disk savings.<\/p>\n<p>As good as the VACUUM command is, having to run it manually could become a tedious task. Thus, by default, there\u2019s an AUTOVACUUM daemon that is enabled and does the job for you automatically while the database server is running. You can find more details about its operations in the AUTOVACUUM PARAMETERS section of the main configuration file \/etc\/postgresql\/9.5\/main\/postgresql.conf.<\/p>\n<p>You can verify that the AUTOVACUUM process is running with:<\/p>\n<pre class=\"brush:bash\">ps aux | grep autovacuum | grep -v grep<\/pre>\n<h2>Summary<\/h2>\n<p>Freeing up space in tables that are constantly updated or where records are often deleted not only will help you save space, but also improve the performance of queries performed on the table. Following the instructions shared in this article you will be contributing to the health of your database and saving valuable storage space.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will help you set up and run your own database management system. We cover a wide range of topics, from installation and configuration, to custom commands and datatypes. With our straightforward tutorials, &hellip;<\/p>\n","protected":false},"author":15,"featured_media":198,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1741","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PostgreSQL VACUUM Command Example - System Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will\" \/>\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.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PostgreSQL VACUUM Command Example - System Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/\" \/>\n<meta property=\"og:site_name\" content=\"System Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/systemcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/gacanepa\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-26T14:15:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-04T14:05:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Gabriel Canepa\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@gacanepa\" \/>\n<meta name=\"twitter:site\" content=\"@systemcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gabriel Canepa\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/\"},\"author\":{\"name\":\"Gabriel Canepa\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/967da353d0f1a1de21c9504942625a5f\"},\"headline\":\"PostgreSQL VACUUM Command Example\",\"datePublished\":\"2016-08-26T14:15:35+00:00\",\"dateModified\":\"2017-12-04T14:05:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/\"},\"wordCount\":1010,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg\",\"articleSection\":[\"PostgreSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/\",\"url\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/\",\"name\":\"PostgreSQL VACUUM Command Example - System Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg\",\"datePublished\":\"2016-08-26T14:15:35+00:00\",\"dateModified\":\"2017-12-04T14:05:19+00:00\",\"description\":\"This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will\",\"breadcrumb\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#primaryimage\",\"url\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg\",\"contentUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.systemcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Databases\",\"item\":\"https:\/\/www.systemcodegeeks.com\/category\/databases\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PostgreSQL\",\"item\":\"https:\/\/www.systemcodegeeks.com\/category\/databases\/postgresql\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"PostgreSQL VACUUM Command Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#website\",\"url\":\"https:\/\/www.systemcodegeeks.com\/\",\"name\":\"System Code Geeks\",\"description\":\"Operating System Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.systemcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.systemcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/systemcodegeeks\",\"https:\/\/x.com\/systemcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/967da353d0f1a1de21c9504942625a5f\",\"name\":\"Gabriel Canepa\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/27b3ea2a3fb1de4ed1c8694a1465c099a86586d8b833a0d852a26d76d750df9f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/27b3ea2a3fb1de4ed1c8694a1465c099a86586d8b833a0d852a26d76d750df9f?s=96&d=mm&r=g\",\"caption\":\"Gabriel Canepa\"},\"description\":\"Gabriel Canepa is a Linux Foundation Certified System Administrator (LFCS-1500-0576-0100) and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work. When he's not typing commands or writing code or articles, he enjoys telling bedtime stories with his wife to his two little daughters and playing with them, the great pleasure of his life.\",\"sameAs\":[\"http:\/\/www.gabrielcanepa.com.ar\/\",\"https:\/\/www.facebook.com\/gacanepa\",\"https:\/\/ar.linkedin.com\/in\/gacanepa\",\"https:\/\/x.com\/gacanepa\"],\"url\":\"https:\/\/www.systemcodegeeks.com\/author\/gabriel-canepa\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PostgreSQL VACUUM Command Example - System Code Geeks - 2026","description":"This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will","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.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/","og_locale":"en_US","og_type":"article","og_title":"PostgreSQL VACUUM Command Example - System Code Geeks - 2026","og_description":"This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will","og_url":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/","og_site_name":"System Code Geeks","article_publisher":"https:\/\/www.facebook.com\/systemcodegeeks","article_author":"https:\/\/www.facebook.com\/gacanepa","article_published_time":"2016-08-26T14:15:35+00:00","article_modified_time":"2017-12-04T14:05:19+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg","type":"image\/jpeg"}],"author":"Gabriel Canepa","twitter_card":"summary_large_image","twitter_creator":"@gacanepa","twitter_site":"@systemcodegeeks","twitter_misc":{"Written by":"Gabriel Canepa","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#article","isPartOf":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/"},"author":{"name":"Gabriel Canepa","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/967da353d0f1a1de21c9504942625a5f"},"headline":"PostgreSQL VACUUM Command Example","datePublished":"2016-08-26T14:15:35+00:00","dateModified":"2017-12-04T14:05:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/"},"wordCount":1010,"commentCount":0,"publisher":{"@id":"https:\/\/www.systemcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg","articleSection":["PostgreSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/","url":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/","name":"PostgreSQL VACUUM Command Example - System Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.systemcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#primaryimage"},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg","datePublished":"2016-08-26T14:15:35+00:00","dateModified":"2017-12-04T14:05:19+00:00","description":"This article is part of our Academy Course titled PostgreSQL Database Tutorial. In this course, we provide a compilation of PostgreSQL tutorials that will","breadcrumb":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#primaryimage","url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg","contentUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-vacuum\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.systemcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Databases","item":"https:\/\/www.systemcodegeeks.com\/category\/databases\/"},{"@type":"ListItem","position":3,"name":"PostgreSQL","item":"https:\/\/www.systemcodegeeks.com\/category\/databases\/postgresql\/"},{"@type":"ListItem","position":4,"name":"PostgreSQL VACUUM Command Example"}]},{"@type":"WebSite","@id":"https:\/\/www.systemcodegeeks.com\/#website","url":"https:\/\/www.systemcodegeeks.com\/","name":"System Code Geeks","description":"Operating System Developers Resource Center","publisher":{"@id":"https:\/\/www.systemcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.systemcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.systemcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.systemcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/systemcodegeeks","https:\/\/x.com\/systemcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/967da353d0f1a1de21c9504942625a5f","name":"Gabriel Canepa","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/27b3ea2a3fb1de4ed1c8694a1465c099a86586d8b833a0d852a26d76d750df9f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/27b3ea2a3fb1de4ed1c8694a1465c099a86586d8b833a0d852a26d76d750df9f?s=96&d=mm&r=g","caption":"Gabriel Canepa"},"description":"Gabriel Canepa is a Linux Foundation Certified System Administrator (LFCS-1500-0576-0100) and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work. When he's not typing commands or writing code or articles, he enjoys telling bedtime stories with his wife to his two little daughters and playing with them, the great pleasure of his life.","sameAs":["http:\/\/www.gabrielcanepa.com.ar\/","https:\/\/www.facebook.com\/gacanepa","https:\/\/ar.linkedin.com\/in\/gacanepa","https:\/\/x.com\/gacanepa"],"url":"https:\/\/www.systemcodegeeks.com\/author\/gabriel-canepa\/"}]}},"_links":{"self":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts\/1741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/comments?post=1741"}],"version-history":[{"count":0,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts\/1741\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/media\/198"}],"wp:attachment":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/media?parent=1741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/categories?post=1741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/tags?post=1741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}