Category: Hans-Juergen Schoenig
Hans-Jürgen Schönig has worked with PostgreSQL since the 90’s. He is the CEO and technical lead of CYBERTEC PostgreSQL International, a market leader in the field. He’s served countless customers around the globe since the year 2000. He is also the author of the well-received “Mastering PostgreSQL” book series, as well as several other books about PostgreSQL replication and administration.
Setting up PostgreSQL streaming replication
There are two types of replication available in PostgreSQL at the moment: Streaming replication & Logical replication. If you are looking to set up streaming replication for PostgreSQL 13, this is the page you have been looking for. This tutorial will show you how to configure PostgreSQL replication and how to set up your database servers […]
Terminating database connections in PostgreSQL
In PostgreSQL, every database connection is a server-side process. This makes PostgreSQL a robust multi-process rather than a multi-threaded solution. However, occasionally people want to terminate database connections. Maybe something has gone wrong, maybe some kind of query is taking too long, or maybe there is a maintenance window approaching. In this blog you will […]
PostgreSQL: Understanding deadlocks
Many might have seen PostgreSQL issue the following error message: “ERROR: deadlock detected”. But what does it really mean? How can we prevent a deadlock and how can we reproduce the problem? Let’s dive into PostgreSQL locking and understand what deadlock and deadlock_timeout really mean. How does a deadlock happen? Many people approach us because […]
Cleaning up a large number of BLOBs in PostgreSQL
PostgreSQL allows end users to store BLOBs (binary large objects) in the database. Many people use these functions to handle data directly in SQL. There has long been a discussion about whether this is a good thing or not. We expect that particular discussion to go on indefinitely. However, if you are in the “pro […]
Getting started with QGIS, PostgreSQL and PostGIS
Visualizing spatial data is an important task. In this mini-tutorial, you will learn how to quickly visualize OpenStreetMap (OSM) data with PostGIS and QGIS. The idea is to get you started as fast as possible, and to make the most out of your data. Installing QGIS QGIS is freely available as Open Source software and […]
PostgreSQL: Get member roles and permissions
PostgreSQL provides a highly sophisticated and powerful security and permission system. It allows you to define users (= roles), groups and so on. However, without a graphical user interface, it is usually a bit tricky to figure out which role is assigned to whom. The following blog post explains how this can be done. Learn […]
How the PostgreSQL query optimizer works
Just like any advanced relational database, PostgreSQL uses a cost-based query optimizer that tries to turn your SQL queries into something efficient that executes in as little time as possible. For many people, the workings of the optimizer itself remain a mystery, so we have decided to give users some insight into what is really […]
Setting up SSL authentication for PostgreSQL
PostgreSQL is a secure database and we want to keep it that way. It makes sense, then, to consider SSL to encrypt the connection between client and server. This posting will help you to set up SSL authentication for PostgreSQL properly, and hopefully also to understand some background information to make your database more secure. […]
PostgreSQL: Getting started on Ubuntu
To make it easier for our readers to install PostgreSQL on Ubuntu, we have compiled a quick guide to getting started. Don’t worry, it’s not too hard. You will learn: How to download PostgreSQL How to install PostgreSQL on Ubuntu How to create a database instance How to ensure the service is running Creating your […]
PostgreSQL: How to write a trigger
Just like in most databases, in PostgreSQL a trigger is a way to automatically respond to events. Maybe you want to run a function if data is inserted into a table. Maybe you want to audit the deletion of data, or simply respond to some UPDATE statement. That is exactly what a trigger is good […]
PostgreSQL: CREATE STATISTICS – advanced query optimization
PostgreSQL query optimization with CREATE STATISTICS is an important topic. Usually, the PostgreSQL optimizer (query planner) does an excellent job. This is not only true for OLTP but also for data warehousing. However, in some cases the optimizer simply lacks the information to do its job properly. One of these situations has to do with […]
PostgreSQL: What is a checkpoint?
Checkpoints are a core concept in PostgreSQL. However, many people don’t know what they actually are, nor do they understand how to tune checkpoints to reach maximum efficiency. This post will explain both checkpoints and checkpoint tuning, and will hopefully shed some light on these vital database internals. How PostgreSQL writes data Before we talk […]