Latest Blog Posts

TRAKTOR 2 is out!
Posted by Ernst-Georg Schmid on 2025-04-25 at 12:35

Check TRAKTOR 2 - less complicated, more stable, cloud ready! Compatible with PostgreSQL 16 and 17.

Contributions for the weeks 16 & 17 (2025)
Posted by Cornelia Biacsics in postgres-contrib.org on 2025-04-25 at 09:08

Stacey Haysler created a document which lists all the available volunteer options for the PostgreSQL project.


Luigi Nardi organized the Malmö PostgreSQL Meetup. Tomas Vondra presented.


April 23 the Postgres Extensions Ecosystem Mini-Summit #4 hosted a panel of users - Celeste Horgan, Sonia Valeja, Alexey Palazhchenko - to gain their POV (recording).


At the April 22 Barcelona PostgreSQL User Group meetup run by Andrea Cucciniello, Dave Pitts, and Nacho Alonso Portillo, Gabriele Bartolini presented "CloudNativePG: The Past, The Present, The Future".


On April 24th Gerard Zuidweg hosted the PostgreSQL User Group NL Spring 2025 Meetup. The following talks were held: Frank Sidi about “Analytics for PostgreSQL: From OLTP to Lakehouse to Petabyte-Scale AI” Hans-Jürgen Schönig about “Running PostgreSQL in Kubernetes made easy” Lightning Talk held by Ellert van Koperen about “Defaults and logical replication do not get along”


On April 23rd Karren Jex gave a lightning talk at DjangoCon Europe about the Diversity Task Force and encouraging folks to get involved in the PostgreSQL community and come along to PostgreSQL events.


Tom Kincaid organized the Boston PostgreSQL Meetup, Adam Wright spoke at the event.


Alastair Turner and Chris Ellis organized the PostgreSQL London Meetup. Tushar Ghotikar, Mauro Parada Crespo and Alastair Turner presented at the event.


Tobias Bussman, Andreas Geppert and Daniel Westermann have been part of the organization team for Swiss Database Synergy Day 2025. [Dirk Krautschick] (https://www.linkedin.com/in/dirk-krautschick), Laurenz Albe, Stephan Keller, Maurizio De Giorgi and Daniel Westermann presented talks.

Striping Postgres data volumes - a free lunch?
Posted by Kaarel Moppel on 2025-04-23 at 21:00
A small follow up on my previous post on various Postgres scale-up avenues in my preferred order. The post received quite a bit of interest - meaning people at least still “wish” performant databases :) And - the ones who are willing to put in a bit of effort with...

TRAKTOR revisited
Posted by Ernst-Georg Schmid on 2025-04-22 at 14:52

Working on TRAKTOR again. The good news is, it still works with PostgreSQL 17.x and I have completely replaced psycopg2 with pg8000 to remove all native dependencies. The bad news is, if you don't want to run the arbiter as superuser it's a complicated dance of permissions, some of which can only be GRANTed by a superuser, and I have to find a way to automate this as far as possible.

On expressions' reordering in Postgres
Posted by Andrei Lepikhov in Postgres Professional on 2025-04-22 at 11:08

Today, I would like to discuss additional techniques to speed up query execution. Specifically, I will focus on rearranging conditions in filter expressions, JOINs, HAVING clauses, and similar constructs. The main idea is that if you encounter a negative result in one condition within a series of expressions connected by the AND operator, or a positive result in one of the conditions linked by the OR operator, you can avoid evaluating the remaining conditions. This can save computing resources. Below, I will explain how much execution efforts this approach saves and how to implement it effectively.

Occasionally, you may come across queries featuring complex filters similar to the following:

SELECT * FROM table
WHERE
  date > min_date AND
  date < now() - interval '1 day' AND
  value IN Subplan AND
  id = 42';

And in practice, it happens that a simple rearrangement of the order of conditions in such an expression allows for speeding up (sometimes quite notably) the query execution time. Why? Each individual operation costs little. However, if it is performed repeatedly on each of millions of the table's rows, then the price of the operation becomes palpable. Especially if other problems, like the table blocks getting into shared buffers, are successfully solved.

This effect is particularly evident on wide tables that contain many variable-length columns. For instance, I often encounter slow IndexScans that become slow when the field used for additional filtering is located somewhere around the 20th (!) position in the table, containing many variable-width columns. Accessing this field requires calculating its offset from the beginning of the row, which takes up processor time and slows down the execution.

The PostgreSQL community has already addressed this issue, as observed in the code. In 2002, commit 3779f7f, which was added by T. Lane, reorganised the clauses by positioning all clauses containing subplans at the end of the clause list (see order_qual_clauses). This change was logical because

[...]

8 Steps to Proactively Handle PostgreSQL Database Disaster Recovery
Posted by Ibrar Ahmed on 2025-04-22 at 06:13

When disaster strikes, whether a natural disaster or a technical event, its impact on your network, database, and end-users can cause both costly downtime and data corruption. Data corruption, whether sparked by hardware failures like dying disks or faulty RAM, software glitches such as operating system bugs, or human missteps like accidental overwrites, is a terrifying prospect for any administrator. Yet, it’s not a death sentence.Your PostgreSQL database is typically a dependable cornerstone of your operations. Still, when disaster strikes, it can swiftly morph into an inaccessible liability, bringing applications to a grinding halt and leaving critical data at risk. PostgreSQL 17 arms you with an enhanced arsenal to tackle this challenge head-on, offering built-in tools like for pinpointing corruption, improved failover slot synchronization to keep replication intact during recovery, and finer-grained Write-Ahead Logging (WAL) control for precise restoration. In this blog, we'll dive deep into the disaster management process, equipping you with real-world commands and expected outputs to diagnose corruption accurately and recover effectively, whether you’re restoring from a robust backup or salvaging scraps from a crippled cluster with no safety net. With the right approach, you can turn panic into a plan and restore order to your database.

Step 1: Detecting Corruption in PostgreSQL

Corruption usually doesn’t introduce itself politely; it sneaks in through failed queries, panicked logs, or startup errors. Identifying corruption is the first step towards resolving it.
Check the PostgreSQL Log Files
Start by inspecting the log files.  Typically, you'll find the log files in or . Within the log files, entry headers indicate the severity level of the log entry; for example:Severity levels indicate:
● ERROR: Read failure, possibly a disk-level issue.
● PANIC: Serious corruption PostgreSQL crashed to prevent further damage.
● FATAL: The server is trying to recover from an unclean shutdown.If your database is [...]

Type alignment and padding bytes: how to not waste space in PostgreSQL tables
Posted by Laurenz Albe in Cybertec on 2025-04-22 at 05:00

Padding bytes in real life: a man tells his child to stand between two big-bellied men so that they can all fit into the elevator
© Laurenz Albe 2025

Saving storage space should not be your first objective in a PostgreSQL database. Very often, the desire to conserve space aggressively comes at the expense of performance. But there is also no reason to needlessly waste space. Therefore, it is a good idea to be familiar with the concepts of data type alignment and padding bytes in PostgreSQL.

What is data type alignment?

When the CPU reads or writes a value from memory, the performance is best if the address of the value is a multiple of the size of the value. For example, a 4-byte integer should start at an address that is a multiple of four. PostgreSQL tries to optimize for performance. Therefore, it makes sure that all values are correctly aligned in memory. Note that alignment is only relevant for data types with a fixed length: PostgreSQL stores variable length data types like text, varchar and numeric without respecting the type alignment.

Whenever PostgreSQL persists data on disk, it organizes these data in pages (also known as buffers or, when on disk, as blocks) of 8kB. To keep things simple and efficient, the layout of a block on disk is exactly the same as the page in memory. As a consequence, PostgreSQL respects the type alignment on disk as well.

PostgreSQL data types can have an alignment of 1, 2, 4 or 8 bytes. You can see the alignment of a data type in the typalign column of the system catalog pg_type:

SELECT typalign,
       string_agg(typname, ', ' ORDER BY length(typname)) AS types
FROM pg_type
WHERE typtype = 'b'            -- base type
  AND typelem = 0              -- no array
  AND typlen <> -1             -- fixed length
  AND typnamespace = 'pg_catalog'::regnamespace  -- system type
  AND typname NOT LIKE 'reg%'  -- no object identifier type
GROUP BY typalign;

 typalign │                                               types
══════════╪════════════════════════════════════════════════════════════════════════════════════════════════════
 c        │ bool, char, uuid
 d        │ xid8, time, int8,
[...]

Mini Summit 4: The User POV
Posted by David Wheeler in Tembo on 2025-04-21 at 17:26
Orange card with large black text reading “The User POV”. Smaller text above reads “04.23.2025” and below reads “Celeste Horgan (Aiven), Sonia Valeja (Percona), & Alexey Palazhchenko (FerretDB)”

And we’re back.

This Wednesday, April 9 at noon America/New_York (16:00 UTC) for Extension Mini Summit #4, where our panel consisting of Celeste Horgan (Aiven), Sonia Valeja (Percona), and Alexey Palazhchenko (FerretDB) will discuss “The User POV”. This session will be a terrific opportunity for those of us who develop extensions to get an earful from the people who use them, in both anger and joy. Bang on the Meetup to register for this live video session.

PgPedia Week, 2025-04-20
Posted by Ian Barwick on 2025-04-20 at 20:10
PostgreSQL 18 changes this week

With all five CommitFests over, we're now into the testing and bugfix phase, and no new features are likely to be added. Having said that, there have been a few tweaks to SQL function performance and handling this week.

PostgreSQL 18 articles Waiting for PostgreSQL 18 – Add modern SHA-2 based password hashes to pgcrypto. (2025-04-17) - Hubert 'depesz' Lubaczewski Waiting for PostgreSQL 18 – Non text modes for pg_dumpall, correspondingly change pg_restore (2025-04-15) - Hubert 'depesz' Lubaczewski Improvements in Expanded Objects in PostgreSQL 18 (2025-04-12) - Jim Mlodgenski

more...

Contributions for the week of 2025-04-14 (Week 15)
Posted by Floor Drees in postgres-contrib.org on 2025-04-20 at 17:31

April 9 Christoph Berg spoke at the Postgres Extensions Ecosystem Mini-Summit #3 (slides, recording, transcript), a series of virtual events leading up to the gathering at PGConf.Dev.


Andrew Atkinson joined the Talking Postgres Podcast to talk about “Helping Rails developers learn Postgres”, back in November. He wrote a blog about it.

Contributions for the week of 2025-04-07 (Week 14)
Posted by Floor Drees in postgres-contrib.org on 2025-04-20 at 17:28

April 2nd the Talking Postgres podcast airs live, with Claire Giordano as the host, Bruce Momjian as the guest, and Aaron Wislang as its producer.


Henrietta Dombrovskaya kicked off Prairie Postgres, with help from Pat Wright, Dian Fay and Anna Bailliekova.

Contributions for the week of 2025-03-31 (Week 13)
Posted by Floor Drees in postgres-contrib.org on 2025-04-20 at 14:58

Gülçin Yıldırım Jelínek organized the [Prague PostgreSQL Meetup, March Edition on March 31st]((https://www.meetup.com/prague-postgresql-meetup/events/306440481). Mayuresh B and Tomáš Vondra presented sessions.


David Wheeler, Floor Drees, Keith Fiske and Yurii Rashkovskii organize a series of virtual gatherings to explore the current state and future of Postgres extension registration, packaging, and distribution, ahead of the Postgres Extensions Ecosystem Summit at PGConf.Dev. March 26, Peter Eisentraut (EDB) talked about implementing an extension search path (recording, slides, blog).

Contributions for the week of 2025-03-24 (Week 12)
Posted by Floor Drees in postgres-contrib.org on 2025-04-20 at 14:49

Nordic PGDay (March 18) was organized by Daniel Gustafsson, Magnus Hagander, Georgios Kokolatos.

The following speakers contributed with a talk:

Lightning Talks:

Program Committee:

  • Georgios Kokolatos
  • Stefanie Janine Stölting
  • Dennis Rilorin
  • Jan Birk

PGDay Paris (March 20) was organized by Eliza Bennett, Julien Riou (OVHcloud), Stéphanie Baltus-Bergamo (Kanop), Valeria Kaplan (Data Egret), Vik Fearing (EDB.)

The speakers:

[...]

Contributions for the week of 2025-03-17 (Week 11)
Posted by Floor Drees in postgres-contrib.org on 2025-04-20 at 14:21

PostgreSQL Person of the week: Emma Saroyan

... Thanks Andreas Scherbaum, for publishing these interviews since - checks notes - February 2020!

Article about PostgreSQL 18
Posted by Pavel Stehule on 2025-04-19 at 14:11

I wrote an article about PostgreSQL 18.  It is in Czech language, but translators from Czech to English, German, ... works relatively well today.

 https://www.root.cz/clanky/postgresql-18-tricet-let-otevreneho-vyvoje-databaze/

Waiting for PostgreSQL 18 – Add modern SHA-2 based password hashes to pgcrypto.
Posted by Hubert 'depesz' Lubaczewski on 2025-04-17 at 10:44
On 5th of April 2025, Álvaro Herrera committed patch: Add modern SHA-2 based password hashes to pgcrypto.   This adapts the publicly available reference implementation on https://www.akkadia.org/drepper/SHA-crypt.txt and adds the new hash algorithms sha256crypt and sha512crypt to crypt() and gen_salt() respectively.   Author: Bernd Helmle <mailings@oopsware.de> Reviewed-by: Japin Li <japinli@hotmail.com> Discussion: https://postgr.es/m/c763235a2757e2f5f9e3e27268b9028349cef659.camel@oopsware.de In pgcrypto extension, … Continue reading "Waiting for PostgreSQL 18 – Add modern SHA-2 based password hashes to pgcrypto."

Fix Postgres <code>strchrnul</code> Compile Error on macOS 15.4
Posted by David Wheeler in Tembo on 2025-04-16 at 19:03

Just a quick note to users of pgenv and anyone else who compiles Postgres on macOS. In macOS 15.4, Apple introduced a new API, strchrnul, which is common from other platforms. As a result attempting to compile Postgres on 15.4 and later will lead to this error:

snprintf.c:414:27: error: 'strchrnul' is only available on macOS 15.4 or newer [-Werror,-Wunguarded-availability-new]
  414 |                         const char *next_pct = strchrnul(format + 1, '%');
      |                                                ^~~~~~~~~
snprintf.c:366:14: note: 'strchrnul' has been marked as being introduced in macOS 15.4 here, but the deployment target is macOS 15.0.0
  366 | extern char *strchrnul(const char *s, int c);
      |              ^
snprintf.c:414:27: note: enclose 'strchrnul' in a __builtin_available check to silence this warning

Tom Lane chased down and committed the fix, which will be in the next releases of Postgres 13-17. It should also go away once macOS 16.0 comes out. But in the meantime, set MACOSX_DEPLOYMENT_TARGET to the current OS release to avoid the error:

export MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion)"

If you use pgenv, you can add it to your configuration. It will need to be added to all the version configs, too, unless they don’t exist and you also set:

PGENV_WRITE_CONFIGURATION_FILE_AUTOMATICALLY=no

New User Management Presentation Online
Posted by Bruce Momjian in EDB on 2025-04-16 at 00:45

I wrote User, User, Who Is the User? in January of 2024, but didn't publish the slides at that time. I was planning to publish them once I delivered the presentation, but it has been a year and I have still not deivered the talk, so I am now publishing the slides.

Waiting for PostgreSQL 18 – Non text modes for pg_dumpall, correspondingly change pg_restore
Posted by Hubert 'depesz' Lubaczewski on 2025-04-15 at 10:46
On 4th of April 2025, Andrew Dunstan committed patch: Non text modes for pg_dumpall, correspondingly change pg_restore   pg_dumpall acquires a new -F/--format option, with the same meanings as pg_dump. The default is p, meaning plain text. For any other value, a directory is created containing two files, globals.data and map.dat. The first contains SQL … Continue reading "Waiting for PostgreSQL 18 – Non text modes for pg_dumpall, correspondingly change pg_restore"

Finding Bottlenecks and Avoiding Over-Optimization via Explain Plans
Posted by semab tariq in Stormatics on 2025-04-15 at 08:27

Performance optimization in a production database is important, but trying to over-optimize can make things more complicated without real improvements.

In this post, I’ll share two very basic EXPLAIN ANALYZE outputs from a production system. A user asked us to help optimize these queries. I've changed the table and column names for privacy. We will look at how to spot slow parts of a query, improve performance the right way, and avoid unnecessary tuning.

Plan A: Identifying and Resolving a Bottleneck

Execution Plan A (Before Optimization)
Nested Loop (cost=1000.42..25607.38 rows=1 width=129) (actual time=78.521..90.445 rows=0 loops=1)
-> Gather (cost=1000.00..25598.95 rows=1 width=65) (actual time=78.520..90.443 rows=0 loops=1)
Workers Planned: 2
Workers Launched: 2
-> Parallel Seq Scan on e (cost=0.00..24598.85 rows=1 width=65) (actual time=75.351..75.351 rows=0 loops=3)
Filter: (() = ''::date) AND (()::text = ''::text)
Rows Removed by Filter:
-> Index Scan using on a (cost=0.42..8.43 rows=1 width=41) (never executed)
Index Cond: (()::text = ()::text)
Filter: (()::text = ''::text)
Planning Time: 0.466 ms
Execution Time: 90.580 ms

The post Finding Bottlenecks and Avoiding Over-Optimization via Explain Plans appeared first on Stormatics.

Indexing vectors in PostgreSQL
Posted by Hans-Juergen Schoenig in Cybertec on 2025-04-15 at 05:00

In the previous post we have imported a fairly large data set containing Wikipedia data, which we downloaded using pgai. However, importing all this data is not enough because we also need to keep an eye on efficiency. Therefore, it is important to understand that indexing is the key to success.

In general, pgvector provides us with two types of indexes that we can use:

- hnsw
- ivfflat

The core questions: When do we need which type of index and how can we create those indexes in the first place?

In general, HNSW (a multilayer graph) is faster during execution time ("SELECT") but is a LOT slower during index creation, as we will see a little later. If index creation time is not an issue, HNSW is definitely a good choice - if index creation time does matter? Well, not so much.

Indexing a table containing vectors

To show how indexing can be done, we are using the following table, which has been created by the vectorization process described in the previous post:

cybertec=# \d demo_wiki_emb_store
                   Table "public.demo_wiki_emb_store"
     Column     |    Type     | Collation | Nullable |      Default      
----------------+-------------+-----------+----------+-------------------
 embedding_uuid | uuid        |           | not null | gen_random_uuid()
 id             | text        |           | not null | 
 chunk_seq      | integer     |           | not null | 
 chunk          | text        |           | not null | 
 embedding      | vector(384) |           | not null | 
Indexes:
    "demo_wiki_emb_store_pkey" PRIMARY KEY, btree (embedding_uuid)
    "demo_wiki_emb_store_id_chunk_seq_key" UNIQUE CONSTRAINT, btree (id, chunk_seq)
Foreign-key constraints:
    "demo_wiki_emb_store_id_fkey" FOREIGN KEY (id) REFERENCES wiki(id) ON DELETE CASCADE

Let us recall the content of those two tables (= raw data and vector data). The relation containing Wikipedia data contains 6.4 million rows that are broken down into 41 million chunks, which are turned into vectors:

cyberte
[...]

Mini Summit 3 Transcript: Apt Extension Packaging
Posted by David Wheeler in Tembo on 2025-04-14 at 22:48
Orange card with large black text reading “APT Extension Packaging”. Smaller text below reads “Christoph Berg, Debian/Cybertec” and “04.09.2025”. A photo of Christoph looking cooly at the camera appears on the right.

Last week Christoph Berg, who maintains PostgreSQL’s APT packaging system, gave a very nice talk on that system at the third PostgreSQL Extension Mini-Summit. We’re hosting five of these virtual sessions in the lead-up to the main Extension Summit at PGConf.dev on May 13 in Montreal, Canada. Check out Christoph’s session on April 9:

There are two more Mini-Summits coming up:

Join the Meetup to attend!

And now, without further ado, thanks to the efforts of Floor Drees, the thing you’ve all been waiting for: the transcript!

Introduction

David Wheeler introduced the organizers:

Christoph Berg, PostgreSQL APT developer and maintainer par excellence, talked through the technical underpinnings of developing and maintaining PostgresSQL and extension packages.

The stream and the closed captions available for the recording are supported by PGConf.dev and its gold level sponsors: Google, AWS, Huawei, Microsoft, and EDB.

APT Extension Packaging

Speaker: Christoph Berg

Hello everyone. So what is this about? It’s about packaging things for PostgresSQL for Debian distributions. We have PostgreSQL server packages,

[...]

Improvements in Expanded Objects in PostgreSQL 18
Posted by Jim Mlodgenski on 2025-04-14 at 14:14

 Way back in PostgreSQL 9.5, there was a simple entry in the release notes:

Improve PL/pgSQL array performance (Tom Lane)


What was behind that was a concept called expanded objects. This introduced the ability for datatypes to have a different in-memory representation from its on-disk representation. In most cases, having the same representation is ideal. For example a 4 byte integer is compact and efficient for long term storage on-disk and is simple to use in-memory. However, for more complex datatypes like arrays or JSON, how they are used in memory in say a PL/pgSQL function, is very different than the needs for long term storage. Expanded objects like arrays and JSON, transition from a flat representation used on-disk and an expanded representation in memory. 

While expanded objects have been in core for a long time, not many extensions that add new datatypes use the concept. We can guess this based on a recent commit that will be available in PostgreSQL 18. Before this commit, if a local variable that uses expanded objects in a PL/pgSQL function was assigned from another local variable, the values would be flattened, assigned and then expanded again. That switching can end up being pretty expensive. This commit greatly helps datatypes like pgcollection. There is a COPY function available in pgcollection to get around this context switching, but knowing to use it does not come naturally for developers when they use the normal assignment operators for any other variable.

Pgcollection is designed for in-memory usage to help people move from databases like Oracle which have concepts like associative arrays to PostgreSQL. For some people, associative arrays are used extensively in their stored procedures and migrating them to PostgreSQL can be difficult. For associative arrays indexed by integers, moving them to PostgreSQL arrays in PL/pgSQL works pretty well, but when they are indexed by strings, inefficient work arounds like using JSON or Hstore are typically the path. Since associative

[...]

PgTraining OpenDay is over!
Posted by Luca Ferrari on 2025-04-14 at 00:00

We are proud of what we have done in Bolzano.

PgTraining OpenDay is over!

Last Friday was PgTraining OpenDay in Bolzano, a free of charge day entirely dedicated to PostgreSQL, that we at PgTraning organized.



PgTraining Staff

We hold the event in the spectacular NOI TechPark in Bozen (Bolzano), north Italy, and the room we had was simply amazing: everything was arranged in a very professional and clean way.

Chris, our host, Enrico and yours truly, had several talks with regard to cool topics like (but not limited to):

  • vector support in PostgreSQL via PgVector, and what you can do with such a tool to create RAG applications;
  • connection pooling (with regard to pgagroal)
  • logical replication and hot upgrade.

The afternoon was a more practical part, when we displayed a few live demos to the audience.

All the material, slides and code samples, including a few Docker images, are available on the PgTraining Gitlab repository, more material will be available in the next days.

As a joke, during the afternoon, Chris embedded the whole Raku documentation in his RAG application and we enjoyed asking the application about how to connect Raku to a PostgreSQL database, with a couple of very detailed and accurate answers.

The audience was very interested in all the topics, and we are glad of such a good day.

We hope to be able to host soon another event like this, and we would like to get some more feedback, even “bad”, in order to arrange an even better event!

PgPedia Week, 2025-04-13
Posted by Ian Barwick on 2025-04-13 at 20:29

Well, the code freeze has come and gone, so it's all over for PostgreSQL 18 development, bar the testing. RC1 is likely due at the start of September, so fire up those test environments sooner rather than later!

Any new features from here on out will be for the future PostgreSQL 19 , whose first CommitFest will start in July ( 2025-07 ).

PostgreSQL 18 changes this week NOT NULL constraints can now be added as NOT VALID NUMA (Non-uniform memory access): initial support for NUMA awareness added view pg_shmem_allocations_numa added pg_get_process_memory_contexts() new function for retrieving memory context stats from processes file_copy_method new GUC specifying the method CREATE DATABASE etc. should use to copy files log_line_prefix %L parameter added showing which server IP address the client has connected to pg_buffercache functions pg_buffercache_evict_relation() and pg_buffercache_evict_all() added view pg_buffercache_numa added PostgreSQL 18 articles Boosting Postgres' EXPLAIN (2025-04-12) - Andrei Lepikhov PostgreSQL 18: Add function to report backend memory contexts (2025-04-09) - Daniel Westermann / dbi services PostgreSQL 18: Allow NOT NULL constraints to be added as NOT VALID (2025-04-08) - Daniel Westermann / dbi services PostgreSQL Merges Initial Support For NUMA Awareness (2025-04-08) -  Michael Larabel / Phoronix Waiting for Postgres 18 – Docker Containers 34% Smaller (2025-04-07) - Jeremy Schneider

more...

Boosting Postgres' EXPLAIN
Posted by Andrei Lepikhov in Postgres Professional on 2025-04-12 at 11:48

Shortly before the code freeze for PostgreSQL 18, Robert Haas added a feature that allows external modules to provide additional information to the EXPLAIN command.

This was a long-awaited feature for me. For an extension that influences the query planning process, providing users with notes on how the extension has affected the plan makes perfect sense. Instead of merely writing to a log file - access to which is often restricted by security policies - this information may be made available through the EXPLAIN command.

The feature introduced many entities that are not easy to figure out: an EXPLAIN option registration routine (RegisterExtensionExplainOption), an explain extension ID, per plan/node hooks, and an option handler.

The pg_overexplain extension, introduced with this feature to demonstrate how it works, seems a little messy and impractical for me, at least in its current state. So, I decided to find out how flexible this new technique is and demonstrate the opportunities opening up to developers with a more meaningful example. I have modified the freely available pg_index_stats extension and added information about the statistics used in the query planning process.

The STAT parameter was added to the list of EXPLAIN options, accepting Boolean ON/OFF values. If it is enabled, information about the statistics used is inserted at the end of the EXPLAIN: the presence of MCV, histogram, and the number of elements in them, as well as the values ​​of stadistinct, stanullfrac, and stawidth.

You might wonder why this is necessary. After all, doesn't the set of statistics directly stem from the list of expressions in the query? Isn't it possible to identify which statistics were utilised by examining the cost-model code for a particular type of expression?

While it is indeed possible, this approach is not always sufficient. We understand the algorithms, but we typically do not have access to the underlying data. As a result, we cannot accurately determine which specific statistics are

[...]

Postgres Protocol and a Side Quest
Posted by Abhishek Chanda on 2025-04-11 at 03:24

I was watching Heikki Linnakangas’s talk on the Postgres protocol. I wanted to follow along with and see the protocol in action for myself. I ran into a problem here: my ostgres server rejected all non secure connections. And with TLS enabled, I could not get wireshark to decode postgres protocol messages because of encryption.

Now, wireshark supports decoding TLS connections using a key log file. Looking through documentation I realized that there is no way for a client to log the TLS keys using psql. So the natural next step was to add that support and try to get that accepted upstream in postgres. Once I understood how this could be implemented, this became my side quest.

PgPedia Week, 2025-04-06
Posted by Ian Barwick on 2025-04-11 at 00:23

CommitFest 52 (2025-03) - the final CommitFest in the PostgreSQL 18 development cycle - is approaching its conclusion, running as always beyond the end of March right up until code freeze on April 8th .

There have been a lot of interesting changes during this end spurt, and combined with personal reasons mean it's been challenging keeping track of them. As always, if there's something missing, please let me know via the feedback form.

PostgreSQL 18 changes this week Optimizer x IN (VALUES ...) converted to x = ANY ... when appropriate Planner SQL language functions now use the plan cache Indexing GiST and btree sortsupport routines for range types added btree skip scan optimization added various other btree optimizations ALTER DEFAULT PRIVILEGES able to define default privileges for large objects COPY COPY TO can copy rows from materialized views pg_replication_slots column two_phase_at added array_sort() function for sorting arrays btree_gist support for sorted gist index builds added pg_dump efficiency improvements when dumping statistics pg_dumpall option -F / --format added pg_recvlogical option --failover added libpq min_protocol_version and max_protocol_version connection parameters added sslkeylogfile connection parameter added

more...

A roadmap to scaling Postgres
Posted by Kaarel Moppel on 2025-04-09 at 21:00
After meeting with another database fellow recently - the evergreen topic of database scaling popped up again. That won’t go out of fashion anytime soon I guess, despite the AI advancements and the rise of Postgres-aware chatbots a la Xata Agent. Namely - when to grab for which designs, technical...

Introducing pgNow: Indexing
Posted by Ryan Booz on 2025-04-09 at 17:54
A few weeks ago I wrote about the introduction of pgNow, a free, cross-platform desktop application from Redgate that is designed to assist users who might lack extensive Postgres experience or a robust monitoring solution. It provides real-time data on queries, indexes, high-value configuration settings, and vacuuming setup and efficiency to help you pinpoint and ... Read more

Top posters

Number of posts in the past two months

Top teams

Number of posts in the past two months

Feeds

Planet

  • Policy for being listed on Planet PostgreSQL.
  • Add your blog to Planet PostgreSQL.
  • List of all subscribed blogs.
  • Manage your registration.

Contact

Get in touch with the Planet PostgreSQL administrators at planet at postgresql.org.