{"id":6413,"date":"2015-12-01T14:27:09","date_gmt":"2015-12-01T13:27:09","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/"},"modified":"2015-12-01T14:27:09","modified_gmt":"2015-12-01T13:27:09","slug":"patching-postgresql-to-a-new-minor-release","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/","title":{"rendered":"Patching PostgreSQL to a new minor release"},"content":{"rendered":"<p>If you are used to patch Oracle databases you probably know how to use opatch to apply PSUs. How does PostgreSQL handle this? Do we need to patch the existing binaries to apply security fixes? The answer is: No. <\/p>\n<p>Lets say you want to patch PostgreSQL from version 9.4.1 to version 9.4.5. What do you need to do? <\/p>\n<p>For this little demo I&#8217;ll create a new database and a sample table in my 9.4.1 instance:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\n(postgres@[local]:5432) [postgres] &gt; select version();\n                                                         version                                                          \n--------------------------------------------------------------------------------------------------------------------------\n PostgreSQL 9.4.1 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9), 64-bit\n(1 row)\n\nTime: 0.483 ms\n(postgres@[local]:5432) [postgres] &gt; create database patch;\nCREATE DATABASE\nTime: 2533.745 ms\n(postgres@[local]:5432) [postgres] &gt; c patch\nYou are now connected to database \"patch\" as user \"postgres\".\n(postgres@[local]:5432)  &gt; create table test ( a int );\nCREATE TABLE\nTime: 2.430 ms\n(postgres@[local]:5432)  &gt; insert into test (a) values ( generate_series(1,100));\nINSERT 0 100\nTime: 0.959 ms\n<\/pre>\n<p>If I now want to bring this version to 9.4.5 the first step I&#8217;ll need to do is to install the 9.4.5 binaries in a separate path. The binaries for my 9.4.1 installation are located here:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres@oel7:\/home\/postgres\/ [PG1] ps -ef | grep PG1\npostgres  2645     1  0 10:51 ?        00:00:00 \/u01\/app\/postgres\/product\/94\/db_1\/bin\/postgres -D \/u02\/pgdata\/PG1\npostgres 14439 11550  0 11:04 pts\/1    00:00:00 grep --color=auto PG1\n<\/pre>\n<p>I already installed the 9.4.5 binaries here:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres@oel7:\/home\/postgres\/ [PG1] ls \/u01\/app\/postgres\/product\/94\/db_5\nbin  include  lib  share\n<\/pre>\n<p>The only tasks I need to do from here on are a) stop the 9.4.1 version:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres@oel7:\/home\/postgres\/ [PG1] which pg_ctl\n\/u01\/app\/postgres\/product\/94\/db_1\/bin\/pg_ctl\npostgres@oel7:\/home\/postgres\/ [PG1] pg_ctl -D \/u02\/pgdata\/PG1 stop -m fast\nwaiting for server to shut down.... done\nserver stopped\npostgres@oel7:\/home\/postgres\/ [PG1] ps -ef | grep PG1\npostgres 14452 11550  0 11:06 pts\/1    00:00:00 grep --color=auto PG1\npostgres@oel7:\/home\/postgres\/ [PG1] \n<\/pre>\n<p>Once the old version is down I just can b) restart with the new binaries:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres@oel7:\/home\/postgres\/ [PG1] which pg_ctl\n\/u01\/app\/postgres\/product\/94\/db_5\/bin\/pg_ctl\npostgres@oel7:\/home\/postgres\/ [PG1] pg_ctl -D \/u02\/pgdata\/PG1 start\nserver starting\npostgres@oel7:\/home\/postgres\/ [PG1] LOG:  database system was shut down at 2015-12-01 11:06:31 CET\nLOG:  MultiXact member wraparound protections are now enabled\nLOG:  database system is ready to accept connections\nLOG:  autovacuum launcher started\n<\/pre>\n<p>That&#8217;s it. The new version is now 9.4.5:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\n(postgres@[local]:5432) [postgres] &gt; select version();\n                                                   version                                                    \n--------------------------------------------------------------------------------------------------------------\n PostgreSQL 9.4.5 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9), 64-bit\n(1 row)\n\nTime: 20.725 ms\n(postgres@[local]:5432) [postgres] &gt; c patch\nYou are now connected to database \"patch\" as user \"postgres\".\n(postgres@[local]:5432)  &gt; select count(*) from test;\n count \n-------\n   100\n(1 row)\n\nTime: 104.297 ms\n<\/pre>\n<p>Usually, for minor versions, you can just install the new binaries and start the instance from there. But anyway, be sure to read the <a href=\"http:\/\/www.postgresql.org\/docs\/current\/interactive\/release.html\" target=\"_blank\" rel=\"noopener\">release notes<\/a> before doing it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are used to patch Oracle databases you probably know how to use opatch to apply PSUs. How does PostgreSQL handle this? Do we need to patch the existing binaries to apply security fixes? The answer is: No. Lets say you want to patch PostgreSQL from version 9.4.1 to version 9.4.5. What do you&hellip;&nbsp;<\/p>\n","protected":false},"author":28,"featured_media":0,"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":[155],"class_list":["post-6413","post","type-post","status-publish","format-standard","hentry","category-database","tag-patching"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.4 (Yoast SEO v28.7) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Patching PostgreSQL to a new minor release - 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\/patching-postgresql-to-a-new-minor-release\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Patching PostgreSQL to a new minor release\" \/>\n<meta property=\"og:description\" content=\"If you are used to patch Oracle databases you probably know how to use opatch to apply PSUs. How does PostgreSQL handle this? Do we need to patch the existing binaries to apply security fixes? The answer is: No. Lets say you want to patch PostgreSQL from version 9.4.1 to version 9.4.5. What do you&hellip;&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/\" \/>\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-01T13:27:09+00:00\" \/>\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=\"2 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\\\/patching-postgresql-to-a-new-minor-release\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/patching-postgresql-to-a-new-minor-release\\\/\"},\"author\":{\"name\":\"Open source Team\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/0b4548362cac3eeff8b3eaf329e3530a\"},\"headline\":\"Patching PostgreSQL to a new minor release\",\"datePublished\":\"2015-12-01T13:27:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/patching-postgresql-to-a-new-minor-release\\\/\"},\"wordCount\":187,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#organization\"},\"keywords\":[\"Patching\"],\"articleSection\":[\"Database\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/patching-postgresql-to-a-new-minor-release\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/patching-postgresql-to-a-new-minor-release\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/patching-postgresql-to-a-new-minor-release\\\/\",\"name\":\"Patching PostgreSQL to a new minor release - dbi services | Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2015-12-01T13:27:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/patching-postgresql-to-a-new-minor-release\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/patching-postgresql-to-a-new-minor-release\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/patching-postgresql-to-a-new-minor-release\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Patching PostgreSQL to a new minor release\"}]},{\"@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\\\/blog\\\/#organization\"},\"alternateName\":\"dbi Blog\",\"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\\\/blog\\\/#organization\",\"name\":\"dbi services\",\"alternateName\":\"dbi\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"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 specialised 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":"Patching PostgreSQL to a new minor release - 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\/patching-postgresql-to-a-new-minor-release\/","og_locale":"en_US","og_type":"article","og_title":"Patching PostgreSQL to a new minor release","og_description":"If you are used to patch Oracle databases you probably know how to use opatch to apply PSUs. How does PostgreSQL handle this? Do we need to patch the existing binaries to apply security fixes? The answer is: No. Lets say you want to patch PostgreSQL from version 9.4.1 to version 9.4.5. What do you&hellip;&nbsp;","og_url":"https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/","og_site_name":"dbi services | Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2015-12-01T13:27:09+00:00","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":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/"},"author":{"name":"Open source Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0b4548362cac3eeff8b3eaf329e3530a"},"headline":"Patching PostgreSQL to a new minor release","datePublished":"2015-12-01T13:27:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/"},"wordCount":187,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/blog\/#organization"},"keywords":["Patching"],"articleSection":["Database"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/","url":"https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/","name":"Patching PostgreSQL to a new minor release - dbi services | Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2015-12-01T13:27:09+00:00","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/patching-postgresql-to-a-new-minor-release\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Patching PostgreSQL to a new minor release"}]},{"@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\/blog\/#organization"},"alternateName":"dbi Blog","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\/blog\/#organization","name":"dbi services","alternateName":"dbi","url":"https:\/\/www.dbi-services.com\/blog\/","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 specialised 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\/6413","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=6413"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/6413\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=6413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=6413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=6413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}