Month: March 2021
When to use tablespaces in PostgreSQL
© Laurenz Albe 2021 Users with an Oracle background consider tablespaces very important and are surprised that you can find so little information about them in PostgreSQL. This article will explain what they are, when they are useful and whether or not you should use them. What is a tablespace Essentially, a tablespace in PostgreSQL […]
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. […]
Traveling Salesman problem with PostGIS and pgRouting
Last time, we experimented with lesser known PostGIS functions to extract areas of interest for sales. Now, let’s extend our example regarding catchment areas by optimizing trips within the area of interest we generated in our previous example, which is around Hamburg. Let’s ask the following question: which order should we visit our major cities […]
Running Postgres in Docker – why and how?
BY Kaarel Moppel – The big question we hear quite often is, “Can and should we run production Postgres workloads in Docker? Does it work?” The answer in short: yes, it will work… if you really want it to… or if it’s all only fun and play, i.e. for throwaway stuff like testing. Containers, commonly […]
PostgreSQL GitHub Actions – Continuous Integration
Intro GitHub Actions (GHA) are altogether a piece of excellent machinery for continuous integration or other automated tasks on your repo. I started to use them from the release day on as a replacement for CircleCI. Not that I think CircleCI is a bad product; I love to have everything in one place if possible. […]
New target_session_attrs settings for high availability and scaling in PostgreSQL v14
© Laurenz Albe 2021 PostgreSQL commit ee28cacf61 has added new options for the target_session_attrs connection parameter. This article explores how the new options can be used to simplify high availability and horizontal scaling solutions. What is target_session_attrs? The PostgreSQL client shared library libpq has support for connection strings to more than one database server: In […]
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 […]