{"id":1849,"date":"2016-10-04T17:15:47","date_gmt":"2016-10-04T14:15:47","guid":{"rendered":"http:\/\/www.systemcodegeeks.com\/?p=1849"},"modified":"2017-12-04T16:07:08","modified_gmt":"2017-12-04T14:07:08","slug":"postgresql-hot-standby-database-replication","status":"publish","type":"post","link":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/","title":{"rendered":"PostgreSQL Hot-Standby Database Replication Tutorial"},"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 <a href=\"https:\/\/www.systemcodegeeks.com\/category\/databases\/postgresql\/\">the previous articles<\/a> of this series, we have learned several PostgreSQL database management skills. So far, those skills have only included working with one database on one machine only. Today we will explain how to set up database replication, with a master machine and a slave one, in order to provide redundancy.<\/p>\n<p>In particular, we will use an approach known as <i>hot standby<\/i>, that allows to run read-only queries on a replicated database (residing on a separate machine) while the main one is under maintenance. Hot Standby is available in PostgreSQL starting with version 9.0.<\/p>\n<p>Given the nature of the topic at hand, we will need an extra Ubuntu server. We will call it \u201cslave\u201d and will change its hostname to ubuntu-slave and set its IP address to 192.168.0.55. The master server (192.168.0.54 &#8211; the one we have been using until now) will be renamed to ubuntu-master. We will begin this article by outlining step by step the prerequisites for the setup, so you should not run into any significant issues.<\/p>\n<div class=\"tip\">If you\u2019re using a VirtualBox-based VM to follow along with this series, you can easily clone it as we explained in <a href=\"https:\/\/www.systemcodegeeks.com\/virtualization\/virtualbox\/cloning-exporting-importing-removing-virtual-machines-virtualbox\/\">Cloning, exporting, importing, and removing virtual machines in VirtualBox<\/a> (don\u2019t forget to check the <b>Reinitialize the MAC address of all network cards<\/b> box). Otherwise, you may need to install an Ubuntu 16.04 server instance from scratch.<\/div>\n<p>[ulp id=&#8217;mezv5fambxsNcQw8&#8242;]<\/p>\n<h2>1. Step 0 &#8211; Change hostnames and IP addresses as needed<\/h2>\n<p>In the master machine, do:<\/p>\n<pre class=\"brush:bash\">hostnamectl set-hostname ubuntu-master<\/pre>\n<p>Next, edit \/etc\/hosts as follows:<\/p>\n<pre class=\"brush:bash\">127.0.0.1\u00a0\u00a0\u00a0 ubuntu-master\r\n192.168.0.55\u00a0\u00a0\u00a0 ubuntu-slave<\/pre>\n<p>In the slave machine:<\/p>\n<pre class=\"brush:bash\">hostnamectl set-hostname ubuntu-slave<\/pre>\n<p>Then edit \/etc\/network\/interfaces and make sure the configuration for enp0s3 (the main NIC) looks as follows:<\/p>\n<pre class=\"brush:bash\">iface enp0s3 inet static\r\naddress 192.168.0.55\r\nnetmask 255.255.255.0\r\ngateway 192.168.0.1\r\ndns-nameservers 8.8.8.8 8.8.4.4<\/pre>\n<p>Next, edit \/etc\/hosts as follows:<\/p>\n<pre class=\"brush:bash\">127.0.0.1\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 ubuntu-slave\r\n192.168.0.54\u00a0\u00a0\u00a0 ubuntu-master<\/pre>\n<p>Finally, restart the network service on both machines<\/p>\n<pre class=\"brush:bash\">systemctl restart networking<\/pre>\n<p>and logout, then log back in to apply changes.<\/p>\n<p>Now we\u2019re ready to talk.<\/p>\n<h2>2. Step 1 &#8211; Configuring the master<\/h2>\n<p>To begin, we will create a dedicated user (repuser in this case) and we will limit the number of simultaneous connections to 1. Enter the psql command prompt and do:<\/p>\n<pre class=\"brush:sql\">CREATE USER repuser REPLICATION LOGIN CONNECTION LIMIT 1 ENCRYPTED PASSWORD 'rep4scg';<\/pre>\n<p>In \/etc\/postgresql\/9.5\/main\/postgresql.conf, make sure the following settings and values are included:<\/p>\n<pre class=\"brush:bash\">listen_addresses = 'localhost,192.168.0.54'\r\nwal_level = 'hot_standby'\r\nmax_wal_senders = 1\r\nhot_standby = on<\/pre>\n<p>and in \/etc\/postgresql\/9.5\/main\/pg_hba.conf:<\/p>\n<pre class=\"brush:bash\">hostssl\u00a0\u00a0\u00a0 replication repuser \u00a0192.168.0.55 \u00a0md5<\/pre>\n<p>Next, switch to user postgres, generate a public key and copy it to the slave. This will allow the master to replicate automatically to the slave:<\/p>\n<pre class=\"brush:bash\">ssh-keygen -t rsa\r\nssh-copy-id 192.168.0.55<\/pre>\n<p>When prompted to enter the password for user postgres in the slave machine, do so before proceeding.<\/p>\n<p>Now restart the database service:<\/p>\n<pre class=\"brush:bash\">sudo systemctl restart postgresql<\/pre>\n<h2>3. Step 2 &#8211; Configuring the slave<\/h2>\n<p>Make sure the database service is stopped before proceeding. Otherwise, you\u2019re in for a nasty database corruption in a few moments.<\/p>\n<pre class=\"brush:bash\">systemctl stop postgresql<\/pre>\n<p>Then edit \/etc\/postgresql\/9.5\/main\/postgresql.conf and make sure the following settings \/ values are included:<\/p>\n<pre class=\"brush:bash\">listen_addresses = 'localhost,192.168.0.55'\r\nwal_level = 'hot_standby'\r\nmax_wal_senders = 1\r\nhot_standby = on<\/pre>\n<p>Finally, add the following line to \/etc\/postgresql\/9.5\/main\/pg_hba.conf:<\/p>\n<pre class=\"brush:bash\">hostssl\u00a0\u00a0\u00a0 replication repuser \u00a0192.168.0.54 \u00a0md5<\/pre>\n<h2>4. Step 3 &#8211; Performing the replication<\/h2>\n<p>This step consists in two sub-steps:<\/p>\n<p><strong>3a-<\/strong> In the master, run the following commands to start an initial backup of all databases currently residing in our server, excluding the logs (you can choose a different backup identification instead of <em>Initial backup<\/em>). If the destination files exist, they will be updated in place; additionally, the data will be compressed during the transfer &#8211; this may come in handy if you have several large databases (otherwise, feel free to ignore the <code>-z<\/code> option of rsync).<\/p>\n<pre class=\"brush:bash\">psql -c \"select pg_start_backup('Initial backup');\"\r\nrsync -cvaz --inplace --exclude=*pg_xlog* \/var\/lib\/postgresql\/9.5\/main\/ 192.168.0.55:\/var\/lib\/postgresql\/9.5\/main\/\r\npsql -c \"select pg_stop_backup();\"<\/pre>\n<p><strong>3b-<\/strong> In the slave, create a .conf file with the connection info to the master server. We will name it recovery.conf and save it in \/var\/lib\/postgresql\/9.5\/main:<\/p>\n<pre class=\"brush:bash\">standby_mode = 'on'\r\nprimary_conninfo = 'host=192.168.0.54 port=5432 user=repuser password=rep4scg'<\/pre>\n<p>where <strong>user<\/strong> and <strong>password<\/strong> need to match the credentials created at the beginning of Step 1.<\/p>\n<p>Now we can proceed to start the database server in the slave:<\/p>\n<pre class=\"brush:bash\">sudo systemctl start postgresql<\/pre>\n<p>and test the replication in the next step.<\/p>\n<h2>5. Step 4 &#8211; Testing the replication<\/h2>\n<p>In the master, we will switch to user postgres and execute a simple query to SELECT and then update a record from the city table in the World_db database. At the same time, we will query that same record in the slave before and after performing the UPDATE in the master. Refer to Fig. 1 for more details:<\/p>\n<pre class=\"brush:bash\">sudo -i -u postgres\r\npsql\r\n\\c World_db;<\/pre>\n<p>then<\/p>\n<pre class=\"brush:sql\">SELECT name, countrycode, population FROM city WHERE name='Brisbane';\r\nUPDATE city SET population=1402568 WHERE name='Brisbane';<\/pre>\n<figure id=\"attachment_1851\" aria-describedby=\"caption-attachment-1851\" style=\"width: 551px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/10\/01postgrelsql7.png\"><img decoding=\"async\" class=\"size-full wp-image-1851\" src=\"http:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/10\/01postgrelsql7.png\" alt=\"Database replication in action\" width=\"551\" height=\"480\" srcset=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/10\/01postgrelsql7.png 551w, https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/10\/01postgrelsql7-300x261.png 300w\" sizes=\"(max-width: 551px) 100vw, 551px\" \/><\/a><figcaption id=\"caption-attachment-1851\" class=\"wp-caption-text\">Figure 1 &#8211; Database replication in action<\/figcaption><\/figure>\n<p>As you can see, the slave was updated automatically the population for Brisbane was changed in the master. If you attempt to perform an UPDATE from the slave, it will fail with the following error: \u201c<strong><em>ERROR: \u00a0cannot execute UPDATE in a read-only transaction<\/em><\/strong>.\u201d<\/p>\n<h2>6. Troubleshooting<\/h2>\n<p>If the database service refuses to start successfully, you will not be able to run psql in the Linux command line. In that case, you will have to troubleshoot using the following resources:<\/p>\n<pre class=\"brush:bash\">systemctl -l status postgresql@9.5-main\r\njournalctl -xe\r\ntail -f \/var\/log\/postgresql\/postgresql-9.5-main.log<\/pre>\n<p>That\u2019s all folks! You should have a PostgreSQL hot standby replication in place.<\/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-1849","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 Hot-Standby Database Replication Tutorial - 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-hot-standby-database-replication\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PostgreSQL Hot-Standby Database Replication Tutorial - 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-hot-standby-database-replication\/\" \/>\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-10-04T14:15:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-04T14:07:08+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-hot-standby-database-replication\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/\"},\"author\":{\"name\":\"Gabriel Canepa\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/967da353d0f1a1de21c9504942625a5f\"},\"headline\":\"PostgreSQL Hot-Standby Database Replication Tutorial\",\"datePublished\":\"2016-10-04T14:15:47+00:00\",\"dateModified\":\"2017-12-04T14:07:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/\"},\"wordCount\":862,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/#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-hot-standby-database-replication\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/\",\"url\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/\",\"name\":\"PostgreSQL Hot-Standby Database Replication Tutorial - System Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg\",\"datePublished\":\"2016-10-04T14:15:47+00:00\",\"dateModified\":\"2017-12-04T14:07:08+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-hot-standby-database-replication\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/#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-hot-standby-database-replication\/#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 Hot-Standby Database Replication Tutorial\"}]},{\"@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 Hot-Standby Database Replication Tutorial - 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-hot-standby-database-replication\/","og_locale":"en_US","og_type":"article","og_title":"PostgreSQL Hot-Standby Database Replication Tutorial - 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-hot-standby-database-replication\/","og_site_name":"System Code Geeks","article_publisher":"https:\/\/www.facebook.com\/systemcodegeeks","article_author":"https:\/\/www.facebook.com\/gacanepa","article_published_time":"2016-10-04T14:15:47+00:00","article_modified_time":"2017-12-04T14:07:08+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-hot-standby-database-replication\/#article","isPartOf":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/"},"author":{"name":"Gabriel Canepa","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/967da353d0f1a1de21c9504942625a5f"},"headline":"PostgreSQL Hot-Standby Database Replication Tutorial","datePublished":"2016-10-04T14:15:47+00:00","dateModified":"2017-12-04T14:07:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/"},"wordCount":862,"commentCount":1,"publisher":{"@id":"https:\/\/www.systemcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/#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-hot-standby-database-replication\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/","url":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/","name":"PostgreSQL Hot-Standby Database Replication Tutorial - System Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.systemcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/#primaryimage"},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/postgresql-logo.jpg","datePublished":"2016-10-04T14:15:47+00:00","dateModified":"2017-12-04T14:07:08+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-hot-standby-database-replication\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/databases\/postgresql\/postgresql-hot-standby-database-replication\/#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-hot-standby-database-replication\/#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 Hot-Standby Database Replication Tutorial"}]},{"@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\/1849","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=1849"}],"version-history":[{"count":0,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts\/1849\/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=1849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/categories?post=1849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/tags?post=1849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}