Infrastructure at your Service

Category Archives: Database Administration & Monitoring

Daniel Westermann

The WAL segment size becomes changeable in PostgreSQL 11

By | Database Administration & Monitoring | No Comments

Up to PostgreSQL 10 the wal segment size was fixed once PostgreSQL was compiled and installed. When you wanted to have something else than the default you needed to tell that to the configure command when building from source, e.g. postgres@pgbox:/home/postgres/postgresql/ [PGDEV] ./configure –with-wal-segsize=64MB For PostgreSQL 11 two commits landed (1 and 2) which change this. Lets have a look.  

 
Read More
Daniel Westermann

When you execute the same statement thousands of times -> prepare it

By | Database Administration & Monitoring | No Comments

Every time you send a SQL statement to PostgreSQL it must be parsed. Parsing is fast, yes, but parsing the same statement a thousand times can quickly sum up to quite some time the database could spend for something else. To avoid that PostgreSQL comes with the prepare statement. Using that you can avoid parsing of statements and only planning and executing will happen. Lets see how that works.  

 
Read More
Joël Cattin

PostgreSQL – logical replication with pglogical

By | Database Administration & Monitoring, Database management, Postgres | No Comments

Although PostgreSQL 10 integrate native logical replication (have a look here or here), it is always interesting to be aware of alternative solutions to the available in-core features. One of those is called pglogical. It’s a Postgres extension developed by 2ndQuadrant, major contributor to PostgreSQL development. The goal of this blog post is to discover how to install pglogical and configure it in order to generate simple logical replication cases. Installation To get the extension…

 
Read More
Daniel Westermann

Updating the partition key now works in PostgreSQL 11

By | Database Administration & Monitoring | No Comments

In the last post about partitioning improvements in PostgreSQL 11 we talked about unique indexes and primary keys on partitioned tables. Both did not work in PostgreSQL 10 but now do in PostgreSQL 11. Another operation that did not work in PostgreSQL 10 and does now in PostgreSQL 11 is: Updating the partition key, which means that a row will move from one partition to another. Lets have a look at that.  

 
Read More
Mouhamadou Diaw

Hash Partitioning in PostgreSQL 11

By | Database Administration & Monitoring | No Comments

PostgreSQL 10 comes with partition support. But Hash Partitioning was not supported. PostgreSQL 11 will support Hash Partition. In the documentation we can read The table is partitioned by specifying a modulus and a remainder for each partition. Each partition will hold the rows for which the hash value of the partition key divided by the specified modulus will produce the specified remainder. For this demonstration let’s create a table with a hash partition drop…

 
Read More
Daniel Westermann

PostgreSQL 11: Procedures and transaction control

By | Database Administration & Monitoring | No Comments

Up to PostgreSQL 10 it was not possible to create procedures in PostgreSQL. Of course you can create functions which do not return anything but the possibility to create a procedure was not there. That will probably change in PostgreSQL 11 when nothing happens which will lead to the removal of that commit. On top of that there was another commit which enables transaction control inside procedures which can be quite interesting. Lets see how…

 
Read More