Book Image

PostgreSQL Cookbook

By : Chitij Chauhan
Book Image

PostgreSQL Cookbook

By: Chitij Chauhan

Overview of this book

<p>PostgreSQL is an open source database management system. It is used for a wide variety of development practices such as software and web design, as well as for handling large datasets (big data).</p> <p>With the goal of teaching you the skills to master PostgreSQL, the book begins by giving you a glimpse of the unique features of PostgreSQL and how to utilize them to solve real-world problems. With the aid of practical examples, the book will then show you how to create and manage databases. You will learn how to secure PostgreSQL, perform administration and maintenance tasks, implement high availability features, and provide replication. The book will conclude by teaching you how to migrate information from other databases to PostgreSQL.</p>
Table of Contents (19 chapters)
PostgreSQL Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Replication using Bucardo


In this recipe, we are going to show you the replication between two databases using Bucardo.

Getting ready

This exercise is carried out on a Red Hat Linux machine.

Install the EPEL package for your Red Hat platform from https://fedoraproject.org/wiki/EPEL.

Then, install these RPMs with the following yum command:

yum install perl-DBI perl-DBD-Pg perl-DBIx-Safe

If it is not already installed, download the PostgreSQL repository from http://yum.pgrpms.org/repopackages.php.

After this, install the following package; this is required because Bucardo is written in Perl:

yum install postgresql93-plperl
  • To install Bucardo, download the latest version of Bucardo, which is Bucardo Version 5.2.0, from http://bucardo.org/wiki/Bucardo.

  • Extract from the tarball file, go to the newly downloaded location, and compile and build the software:

      tar xvfz Bucardo-5.2.0.tar.gz
    
      cd Bucardo-5.2.0
    
      perl Makefile.PL
    
      make
     
      make install
    

How to do it...

The following is the complete sequence...