{"id":30302,"date":"2024-01-23T08:32:24","date_gmt":"2024-01-23T07:32:24","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=30302"},"modified":"2024-01-23T08:32:24","modified_gmt":"2024-01-23T07:32:24","slug":"postgresql-backups-with-pg_back","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/postgresql-backups-with-pg_back\/","title":{"rendered":"PostgreSQL Backups with pg_back"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-1-introduction\">1. Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In the world of PostgreSQL database management, ensuring robust backup strategies is mandatory. This week I discovered on postgresql.org latest news one useful tool that streamlines this process: <a href=\"https:\/\/github.com\/orgrim\/pg_back\"><code>pg_bac<\/code>k<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>pg_back<\/code> serves as a dedicated dumping tool designed for PostgreSQL. Its primary objective is to facilitate the comprehensive dumping of either all or specific databases, along with global entities, in a user-specified format. This distinction is crucial, as a conventional call to <code>pg_dumpall<\/code> only exports databases in the plain SQL format.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Under the hood, <code>pg_back<\/code> make use of <code>pg_dumpall<\/code> to handle the dumping of roles and tablespaces definitions. Additionally, it utilizes <code>pg_dump<\/code> to create separate files, each containing the dump of an entire database or the selected databases, all in a customized format. This approach ensures flexibility and precision in the backup process. It also purges old dumps and has many different features, let&#8217;s discover that !<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting, just know that for this blog I&#8217;m running PostgreSQL 16beta1 installed from source on the OS openSUSE 15.4. The use of the beta version of Postgres caused me issues when I wanted to restore my dumps (pg_restore: error: unsupported version (1.15) in file header), so don&#8217;t be surprised if you noticed that I updated to PostgreSQL 16.1 during the blog.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-2-installation\">2. Installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We are going to install pg_back from source, for this, you need go version 1.20 at least.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>11:23:15 postgres@localhost:\/home\/postgres\/ &#091;pgdummy] go install <a href=\"mailto:github.com\/orgrim\/pg_back@latest\">github.com\/orgrim\/pg_back@latest<\/a><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To make <code>pg_back<\/code> globally accessible, add its path to your <code>PATH<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres@localhost:\/home\/postgres\/ &#091;pgdummy] vi ~\/.bashrc\nexport PATH=$PATH:\/home\/postgres\/go\/bin\npostgres@localhost:\/home\/postgres\/ &#091;pgdummy] source ~\/.bashrc\npostgres@localhost:\/home\/postgres\/ &#091;pgdummy] pg_back --version\npg_back version 2.2.0\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-3-creating-databases-and-tables\">3. Creating Databases and Tables<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Just to have some content to dump later, create databases and a table with some data.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres=# create database test1;\nCREATE DATABASE\npostgres=# create database test2;\nCREATE DATABASE\npostgres=# \\c test1 postgres\npsql (16beta1 dbi services build, server 14.9)\nYou are now connected to database \"test1\" as user \"postgres\".\n\ntest1=# INSERT INTO t1 (id)\nSELECT generate_series(1, 1001000);\nINSERT 0 1001000\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-4-setting-up-backup-repository\">4. Setting up Backup Repository<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By default, the dumps from pg_back will go to \/var\/backups\/postgresql.<br>You can&nbsp;use the&nbsp;<code>-b<\/code> parameter&nbsp;to give the path where to save the dump files.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres@localhost:\/home\/postgres\/ &#091;PG16] mkdir \/u99\/pgdata\/16beta1\/backup<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-5-initial-backup\">5. Initial Backup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Perform the first test dump without extra parameters. You need to use the necessary PostgreSQL connection parameters.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">pg_back -U postgres -p 5432 -d test1 -b \/u99\/pgdata\/16beta1\/backup\/<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>11:53:30 postgres@localhost:\/home\/postgres\/ &#091;PG16] pg_back -U postgres -p 5432 -d test1 -b \/u99\/pgdata\/16beta1\/backup\/\n2024\/01\/18 11:54:22 INFO: dumping globals\n2024\/01\/18 11:54:23 INFO: dumping instance configuration\n2024\/01\/18 11:54:23 INFO: dumping database postgres\n2024\/01\/18 11:54:23 INFO: dump of postgres to \/u99\/pgdata\/16beta1\/backup\/postgres_2024-01-18T11:54:23+01:00.dump done\n2024\/01\/18 11:54:23 INFO: dumping database test1\n2024\/01\/18 11:54:23 INFO: dump of test1 to \/u99\/pgdata\/16beta1\/backup\/test1_2024-01-18T11:54:23+01:00.dump done\n2024\/01\/18 11:54:23 INFO: dumping database test2\n2024\/01\/18 11:54:23 INFO: dump of test2 to \/u99\/pgdata\/16beta1\/backup\/test2_2024-01-18T11:54:23+01:00.dump done\n2024\/01\/18 11:54:23 INFO: waiting for postprocessing to complete\n2024\/01\/18 11:54:23 INFO: purging old dumps\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Control the dump files creation<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>11:54:23 postgres@localhost:\/home\/postgres\/ &#091;PG16] cd \/u99\/pgdata\/16beta1\/backup\/\n11:54:45 postgres@localhost:\/u99\/pgdata\/16beta1\/backup\/ &#091;PG16] ll\ntotal 656\n-rw------- 1 postgres postgres   4586 Jan 18 11:54 hba_file_2024-01-18T11:54:23+01:00.out\n-rw------- 1 postgres postgres   1679 Jan 18 11:54 ident_file_2024-01-18T11:54:23+01:00.out\n-rw------- 1 postgres postgres    372 Jan 18 11:54 pg_globals_2024-01-18T11:54:22+01:00.sql\n-rw------- 1 postgres postgres    453 Jan 18 11:54 pg_settings_2024-01-18T11:54:23+01:00.out\n-rw------- 1 postgres postgres   1486 Jan 18 11:54 postgres_2024-01-18T11:54:23+01:00.dump\n-rw------- 1 postgres postgres 641324 Jan 18 11:54 test1_2024-01-18T11:54:23+01:00.dump\n-rw------- 1 postgres postgres   1259 Jan 18 11:54 test2_2024-01-18T11:54:23+01:00.dump\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-6-advanced-usage-of-pg-back-parameters\">6. Advanced Usage of pg_back Parameters<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-6-1-exclude-database\">6.1 Exclude Database<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Exclude a specific database from the backup with option -D<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>11:57:07 postgres@localhost:\/u99\/pgdata\/16beta1\/ &#091;PG16] mkdir backup_exclude_db\n11:57:18 postgres@localhost:\/u99\/pgdata\/16beta1\/ &#091;PG16] pg_back -U postgres -p 5432 -d test1 -D test2 -b \/u99\/pgdata\/16beta1\/backup_exclude_db\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Notice that the dump for the database test2 is missing in .\/backup_exclude_db<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-6-2-compress-backup\">6.2 Compress Backup<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Compress the backup to save space with option -Z<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>12:06:20 postgres@localhost:\/u99\/pgdata\/16beta1\/ &#091;PG16] mkdir backup_compressed\n12:06:44 postgres@localhost:\/u99\/pgdata\/16beta1\/ &#091;PG16] pg_back -U postgres -p 5432 -d test1 -Z 4 -b \/u99\/pgdata\/16beta1\/backup_compressed\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the difference of size between the backup<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>12:06:52 postgres@localhost:\/u99\/pgdata\/16beta1\/ &#091;PG16] du -sh *\n656K    backup\n524K    backup_compressed\n712K    backup_exclude_db\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-7-pg-back-config-file\">7. pg_back config file<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can manage the behavior of pg_back thanks to a config file. You can find a template of this file on the github of the project <a href=\"https:\/\/github.com\/orgrim\/pg_back\/blob\/master\/pg_back.conf\">https:\/\/github.com\/orgrim\/pg_back\/blob\/master\/pg_back.conf<\/a><br>Inside the template, you will find all possible options to use pg_back. We fill the PostgreSQL connection parameters and adjust the purge one. Create and edit the <code>pg_back.conf<\/code> file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/u99\/pgdata\/16beta1\/pg_back.conf\n# PostgreSQL connection options. This are the usual libpq\n# variables. dbname is the database used to dump globals, acl,\n# configuration and pause replication. password is better set in\n# ~\/.pgpass\nhost =\nport = 5432\nuser = postgres\ndbname = db1\nbackup_directory = \/u99\/pgdata\/16beta1\/backup_config_file\/{dbname}\n# Purge dumps older than this number of days.\npurge_older_than = 6m<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run a backup with the config file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>14:36:44 postgres@localhost:\/u99\/pgdata\/16beta1\/ &#091;PG16] mkdir backup_config_file\n14:41:13 postgres@localhost:\/u99\/pgdata\/16beta1\/ &#091;PG16] pg_back -c pg_back.conf<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-8-restoring-database-dump\">8. Restoring Database Dump<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Lastly, we need to see how to restore the dumps from pg_back. First, for our tests, drop the database to delete the data and recreate the database before restoring.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres=# drop database test1;\nDROP DATABASE\npostgres=# create database test1;\nCREATE DATABASE\n\npostgres=# \\c test1 postgres\npsql (16beta1 dbi services build, server 14.9)\nYou are now connected to database \"test1\" as user \"postgres\".\ntest1=# \\dt\nDid not find any relations.\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restore the database test1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>16:35:06 postgres@localhost:\/u99\/pgdata\/16beta1\/ &#091;PG16] pg_restore -U postgres -p 5432 -v --exit-on-error 2&gt; restore_errors.log -d test1 backup_config_file\/test1\/test1_2024-01-18T16:32:47+01:00.dump<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify that our table t1 and its data have been restored<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres=# \\c test1\npsql (16.1 dbi services build, server 14.9)\nYou are now connected to database \"test1\" as user \"postgres\".\ntest1=# \\dt\n        List of relations\n Schema | Name | Type  |  Owner\n--------+------+-------+----------\n public | t1   | table | postgres\n(1 row)\n\ntest1=# select count(*) from t1;\n  count\n---------\n 1001000\n(1 row)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-9-conclusion\">9. Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In the world of database management, the importance of robust backup strategies cannot be overstated. As we explored in this blog, the use of pg_back proves to be a valuable addition to the PostgreSQL toolkit, simplifying the backup process with its dedicated dumping capabilities.<br>In conclusion, pg_back stands as a valuable asset for PostgreSQL administrators, offering a versatile and easy approach to database backup management. As you integrate this tool into your PostgreSQL environment, you gain simplified control and flexibility.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction In the world of PostgreSQL database management, ensuring robust backup strategies is mandatory. This week I discovered on postgresql.org latest news one useful tool that streamlines this process: pg_back. pg_back serves as a dedicated dumping tool designed for PostgreSQL. Its primary objective is to facilitate the comprehensive dumping of either all or specific&hellip;&nbsp;<\/p>\n","protected":false},"author":87,"featured_media":0,"comment_status":"open","ping_status":"closed","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,83],"tags":[202,1836,1581],"class_list":["post-30302","post","type-post","status-publish","format-standard","category-database","category-postgresql","tag-backup","tag-dump","tag-postgresql-dump"],"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>PostgreSQL Backups with pg_back - dbi services Blog<\/title>\n<meta name=\"description\" content=\"Explore the power of pg_back, a dedicated dumping tool for PostgreSQL, in my comprehensive blog. Learn how to install, configure, and make use of advanced features for efficient database backups\" \/>\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\/postgresql-backups-with-pg_back\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PostgreSQL Backups with pg_back\" \/>\n<meta property=\"og:description\" content=\"Explore the power of pg_back, a dedicated dumping tool for PostgreSQL, in my comprehensive blog. Learn how to install, configure, and make use of advanced features for efficient database backups\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/postgresql-backups-with-pg_back\/\" \/>\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=\"2024-01-23T07:32:24+00:00\" \/>\n<meta name=\"author\" content=\"Joan Frey\" \/>\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=\"Joan Frey\" \/>\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\\\/postgresql-backups-with-pg_back\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/postgresql-backups-with-pg_back\\\/\"},\"author\":{\"name\":\"Joan Frey\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/565fa40326c9a1329bcf424186e01a04\"},\"headline\":\"PostgreSQL Backups with pg_back\",\"datePublished\":\"2024-01-23T07:32:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/postgresql-backups-with-pg_back\\\/\"},\"wordCount\":588,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"keywords\":[\"Backup\",\"dump\",\"PostgreSQL dump\"],\"articleSection\":[\"Database\",\"PostgreSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/postgresql-backups-with-pg_back\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/postgresql-backups-with-pg_back\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/postgresql-backups-with-pg_back\\\/\",\"name\":\"PostgreSQL Backups with pg_back - dbi services Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2024-01-23T07:32:24+00:00\",\"description\":\"Explore the power of pg_back, a dedicated dumping tool for PostgreSQL, in my comprehensive blog. Learn how to install, configure, and make use of advanced features for efficient database backups\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/postgresql-backups-with-pg_back\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/postgresql-backups-with-pg_back\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/postgresql-backups-with-pg_back\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PostgreSQL Backups with pg_back\"}]},{\"@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\\\/565fa40326c9a1329bcf424186e01a04\",\"name\":\"Joan Frey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/FRJ_web-min-scaled.jpg\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/FRJ_web-min-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/FRJ_web-min-scaled.jpg\",\"caption\":\"Joan Frey\"},\"description\":\"Joan Frey has more than 8 years of experience in the IT sector, including 5 years as a database and Linux consultant. He is specialized in PostgreSQL high availability (Patroni, etcd, HAProxy, Keepalived) and also manages MariaDB and MySQL environments. His knowledge includes Linux (RHEL, SLES), Windows Server, backup and restore strategies (pgBackRest, mariabackup), Ansible automation, as well as development in Python, Go, TypeScript and SQL. Since 2021, he has been working at dbi services, where he installs, supports and documents database infrastructures for customers, often under SLA contracts, and coaches their internal teams. He also contributes to internal tools such as DMK (Database Management Kit), the Resource Planning ERP and the Yak cloud tool. Before joining dbi services, he was an Analyst Developer Intern at Euro Information D\u00e9veloppement (France) in Strasbourg. His branch related experience includes banking, fintech, payment services, telecommunications, aviation, watchmaking, public administration, energy, insurance, pharmaceuticals and public transport.\",\"sameAs\":[\"ree years of experience in the IT sector, specializing in C and C# development, with additional knowledge of Linux and SQL. Prior to dbi services, he was an Analyst Developer Intern at Euro Information D\u00e9veloppement in Strasbourg and an IT Help Desk intern at EuroAirport. He holds a computer engineering degree specializing in information systems from the University of Technology of Belfort-Montb\u00e9liard (UTBM). His industry experience includes banking and aviation.\"],\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/joan-frey\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"PostgreSQL Backups with pg_back - dbi services Blog","description":"Explore the power of pg_back, a dedicated dumping tool for PostgreSQL, in my comprehensive blog. Learn how to install, configure, and make use of advanced features for efficient database backups","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\/postgresql-backups-with-pg_back\/","og_locale":"en_US","og_type":"article","og_title":"PostgreSQL Backups with pg_back","og_description":"Explore the power of pg_back, a dedicated dumping tool for PostgreSQL, in my comprehensive blog. Learn how to install, configure, and make use of advanced features for efficient database backups","og_url":"https:\/\/www.dbi-services.com\/blog\/postgresql-backups-with-pg_back\/","og_site_name":"dbi services Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2024-01-23T07:32:24+00:00","author":"Joan Frey","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","twitter_misc":{"Written by":"Joan Frey","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/postgresql-backups-with-pg_back\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/postgresql-backups-with-pg_back\/"},"author":{"name":"Joan Frey","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/565fa40326c9a1329bcf424186e01a04"},"headline":"PostgreSQL Backups with pg_back","datePublished":"2024-01-23T07:32:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/postgresql-backups-with-pg_back\/"},"wordCount":588,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"keywords":["Backup","dump","PostgreSQL dump"],"articleSection":["Database","PostgreSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/postgresql-backups-with-pg_back\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/postgresql-backups-with-pg_back\/","url":"https:\/\/www.dbi-services.com\/blog\/postgresql-backups-with-pg_back\/","name":"PostgreSQL Backups with pg_back - dbi services Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2024-01-23T07:32:24+00:00","description":"Explore the power of pg_back, a dedicated dumping tool for PostgreSQL, in my comprehensive blog. Learn how to install, configure, and make use of advanced features for efficient database backups","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/postgresql-backups-with-pg_back\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/postgresql-backups-with-pg_back\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/postgresql-backups-with-pg_back\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"PostgreSQL Backups with pg_back"}]},{"@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\/565fa40326c9a1329bcf424186e01a04","name":"Joan Frey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/FRJ_web-min-scaled.jpg","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/FRJ_web-min-scaled.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/FRJ_web-min-scaled.jpg","caption":"Joan Frey"},"description":"Joan Frey has more than 8 years of experience in the IT sector, including 5 years as a database and Linux consultant. He is specialized in PostgreSQL high availability (Patroni, etcd, HAProxy, Keepalived) and also manages MariaDB and MySQL environments. His knowledge includes Linux (RHEL, SLES), Windows Server, backup and restore strategies (pgBackRest, mariabackup), Ansible automation, as well as development in Python, Go, TypeScript and SQL. Since 2021, he has been working at dbi services, where he installs, supports and documents database infrastructures for customers, often under SLA contracts, and coaches their internal teams. He also contributes to internal tools such as DMK (Database Management Kit), the Resource Planning ERP and the Yak cloud tool. Before joining dbi services, he was an Analyst Developer Intern at Euro Information D\u00e9veloppement (France) in Strasbourg. His branch related experience includes banking, fintech, payment services, telecommunications, aviation, watchmaking, public administration, energy, insurance, pharmaceuticals and public transport.","sameAs":["ree years of experience in the IT sector, specializing in C and C# development, with additional knowledge of Linux and SQL. Prior to dbi services, he was an Analyst Developer Intern at Euro Information D\u00e9veloppement in Strasbourg and an IT Help Desk intern at EuroAirport. He holds a computer engineering degree specializing in information systems from the University of Technology of Belfort-Montb\u00e9liard (UTBM). His industry experience includes banking and aviation."],"url":"https:\/\/www.dbi-services.com\/blog\/author\/joan-frey\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/30302","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\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=30302"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/30302\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=30302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=30302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=30302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}