PostgreSQL Tutorial

PostgreSQL Tutorial: Setting up Logical Replication

Summary: Built-in logical replication and logical decoding were introduced in PostgreSQL 10. Over a period of time, more and more features are being implemented within logical replication. It is helpful when a selected list of tables needs to be replicated from multiple OLTP databases to a single OLAP database for reporting and analysis.

Continue reading

PostgreSQL Tutorial: Setting up Streaming Replication

Summary: Streaming replication (physical replication), which is byte-by-byte replication, involves a continuous application of WAL records from Primary to Standby. As it uses a file-based log shipping method, it is one of the fastest replication methods when compared with logical replication or other trigger-based methods.

Continue reading

PostgreSQL Tutorial: Backing up a database cluster using pg_basebackup

Summary: pg_basebackup is the built-in binary format backup tool available with PostgreSQL. Only the backups taken using pg_basebackup can be used for point-in-time recovery and not pg_dump or pg_dumpall.

Continue reading

PostgreSQL Tutorial: Restoring a backup taken using pg_basebackup

Summary: In the backing up a database cluster tutorial, we discussed how pg_basebackup can be used to take a physical backup of the PostgreSQL cluster. We may restore this backup in various situations, such as creating a standby server in replication or recovering a database to a point in time. In this tutorial, we shall see the steps required to restore a backup taken using pg_basebackup.

Continue reading

PostgreSQL Tutorial: Minor Version Update

Summary: In this tutorial, we shall see how a minor version upgrade can be performed when using PostgreSQL 13.

Continue reading

PostgreSQL Tutorial: Install PostgreSQL on Linux using yum

Summary: in this tutorial, you will learn how to download and install PostgreSQL on Linux using yum.

Continue reading

PostgreSQL Tutorial: Install PostgreSQL on Ubuntu using apt

Summary: in this tutorial, you will learn how to download and install PostgreSQL on Ubuntu using apt.

Continue reading

PostgreSQL Tutorial: List Triggers

Summary: Triggers are the functions that are fired/invoked when a certain specified event occurs. Sometimes we need to list the triggers in PostgreSQL to know which triggers and how many triggers are associated to a table. In this article, we will look at the methods to list down all the triggers in our database and also list all the triggers related to a table.

Continue reading

PostgreSQL Tutorial: Access PostgreSQL using Excel

Summary: You can use Microsoft Excel to access data from a PostgreSQL database using ODBC connector. With ODBC Driver, you can import the data directly into an Excel Spreadsheet and present it as a table. Make sure that you use matching Excel and ODBC Driver, e.g. if you are using the 64-bit version of Excel, you will need to install a 64-bit ODBC Driver.

Continue reading

PostgreSQL Tutorial: Export Table using DBeaver

Summary: in this tutorial, you will learn how to export data from PostgreSQL tables to files in different types and formats.

Continue reading