Skip to content
ImagineWorld

The E volution of Postgre SQL

node_idnode-book_ai-ready-postgresql-18_chapter-02-the-e-volution-of-postgre-sql
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num2
chapter_titleThe E volution of Postgre SQL
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Chapter 2 — The E volution of Postgre SQL

Section titled “Chapter 2 — The E volution of Postgre SQL”

Postgres started in 1986 as a research project led by Professor Michael Stonebraker at the University of California, Berkeley. It is called “Postgres” as it was the successor to Ingres, one of the seminal relational databases inspired by the work of Edgar Codd. The team around Michael Stonebraker took several fundamental decisions that still influence PostgreSQL today and are foundational to its success:

  • Choose an object-relational design that allows for easy adoption of new data types, and
  • Leverage the operating system capabilities as much as possible and adhere to the POSIX interface standard to allow almost universal portability.

Postgres was a research project until 1994, when it was spun out of the University of California and released under an extremely permissive open source license, allowing a wide developer and user community to use and improve on it. This was likely another reason why Postgres became so widely successful.

In 1996, a concerted open source effort began to drive Postgres forward and make it SQL-compatible, and rebrand it as PostgreSQL. This has resulted in a hugely successful project, which in 2024 received contributions from AWS, Crunchy Data, EDB, Fujitsu, Microsoft, Neon, and many others, with over 200 individuals from around the globe making at least one code commit.

Today, PostgreSQL has a very stable and fast-moving community process governed by a core team of seven members, 30 committers who can modify the code, 50 major contributors who tend to focus on specific areas, and over 400 individuals who commit code, review patches, test, or report issues. Using an annual release cycle, the passion of a global development community, and a completely public development process has allowed the PostgreSQL community to be innovative and fast-moving without compromising quality.

This chapter focuses on the following:

  • The evolution of PostgreSQL’s capabilities over time
  • The new features that have been added over the last 10 years in the transactional, analytical, and AI space
  • How those features have propelled PostgreSQL to become the (almost) universal database for modern business applications
  • Guard rails for when to use PostgreSQL and when to complement Postgres with specialty solutions

The evolution of key capabilities for transactional, analytical, and AI use cases

Section titled “The evolution of key capabilities for transactional, analytical, and AI use cases”

PostgreSQL started with a focus on transactional use cases, but in the last 10+ years, it has added many new capabilities in the analytics and AI areas, while at the same time evolving its transactional muscle.

This expansion of capabilities occurred in parallel with an evolution in business requirements in several areas, such as:

  1. Real-time data-driven decision-making
  2. Cost reduction
  3. Agility to react to new business opportunities.

Increasingly, data-driven decisions need to be taken in real time, for example, by analyzing production-line performance and shifting workloads, or by analyzing sales performance by store and by product to redirect replenishment deliveries to keep shelves stocked in food retail. The need for cost reduction was driven by competitive pressures on margin, but also by the opportunity to enter new business areas, where the cost per transaction needed to be significantly lower. Fintech is the premier example of making new services available in lower-margin markets. Acquisitions, divestitures, and new business models require very fast implementation of new IT support solutions – nobody can wait another year before the new e-commerce site for the new product line goes live.

Modern enterprise solutions now integrate transactional needs with analytical and AI requirements, because separate solutions with separate roadmaps, separate operating procedures, and separate data models integrated by data pipelines using separate change management procedures cause too many maintenance problems and no longer meet the business need of a real-time analytics solution that can immediately act on the business. Open source solutions, such as PostgreSQL, can drastically reduce costs, sometimes by over 80%. Microservices approaches, rather than monoliths, provide tremendous agility and reduce time to market for data-driven solutions.

The result of this alignment is that PostgreSQL has become the #1 database option for developers, as evidenced by its repeat #1 ranking in the Stack Overflow Developer Survey for 2023, 2024, and 2025. To understand why, this section highlights key capabilities added, grouped by use case for clarity (though some apply across the board).

PostgreSQL transactional benchmarks show significant and steady performance gains each year in terms of transactions per second (TPS) (see Julien Tachoires’ analysis: https://www.enterprisedb.com/blog/performance-comparison-major-PostgreSQL-versions). These improvements come from both incremental refinements, such as reducing locking contention, and major new features, including parallel query, just-in-time (JIT) compilation, new indexing mechanisms, and new I/O mechanisms.

Equally as important, new features are constantly being added that open up modern workloads and new architectures. Key advancements can be seen in the following areas:

  • E nabling d istributed a rchitectures and m icroservices:
    1. Foreign Data Wrappers (FDW s) make it easier to deploy PostgreSQL into a network of communicating microservices. Starting with inserts, updates, and deletes for FDW in version 9.3 of PostgreSQL, we now have parallel query execution, two-phase commit, and join pushdown. 2. Logical replication fulfils a similar role as it allows for distributing data among database instances, sharing data selectively, and defining replicas that are optimized for specific tasks (e.g., analytics). Using parallel apply, logical replication has become a powerful tool, enabling new architectures, such as microservices, and near-zero-downtime maintenance. Parallel apply allows the subscriber (i.e., the receiving node) to apply data changes using several workers that work in parallel, thus improving the speed at which updates, inserts, and deletes are processed and reducing latency significantly.
  • Supporting m odern d ata t ypes and i n- d atabase l ogic:
    1. JSONB document data structures were introduced in PostgreSQL 9.4, and today PostgreSQL has a complete toolbox to work with document data in the context of an ACID-compliant transactional database. JSON _ TABLE and JSON Path (see Chapter 7, Designing for High Transaction Volumes and Writing Efficient Transactional Code) have made this a feature-complete solution that has also been shown to outperform many specialty database solutions in key workloads. 2. Stored procedures and functions allow you to embed significant logic components right next to the data and benefit from the database’s transactional mechanisms. Transaction control, savepoints, and subtransactions can be written in PL/pgSQL, Postgres’ native procedural language, and in Perl, Python, and TCL.
  • Boosting p erformance and s calability for l arge w orkloads:
    1. Asynchronous I/O, introduced in PostgreSQL 18 with a focus on read-only workloads and tablespace-level I/O concurrency control, are enormous performance boosts for write-heavy workloads, even though PostgreSQL delegates I/O to the operating system and does not use direct I/O, unlike some other databases. 2. Native partitioning, reduced locking for partition management, parallel processing of partitions, and improved pruning for queries that rely on partitions, combined with the introduction of UUIDs V4 in Postgres 13 and UUID V7 in PostgreSQL 18, open PostgreSQL up to workloads with huge data volumes that benefit from partitions without being impacted by heavy locks.

These enhancements in architecture, data types, processing logic, and throughput have made PostgreSQL the obvious choice for developers working with ACID transactional workloads. To support integrated transactional-analytical workloads, similar analytics enhancements have been added in the last 10 years.

PostgreSQL grew up with a focus on transactional workloads but has long supported “tactical analytics” through operational data stores (ODS s), which used streaming replication to offload read workloads. PostgreSQL also supported analytics libraries such as R or MADlib and had powerful full-text search capabilities in its tsvector and trigram implementations.

However, recent versions have introduced powerful new capabilities that make PostgreSQL an attractive choice for very demanding analytics applications that were previously out of its range. These advancements focus on data summarization, complex querying, and performance at scale, such as:

  • Materialized views were added to PostgreSQL in version 9.3. In version 11, their creation was parallelized. Starting with version 12, the materialized views could be refreshed concurrently. This now lays the foundation for managing denormalized data representations that are optimized for analytics, such as stars or snowflakes.
  • Analytics-specific data representations were introduced in PostgreSQL version 9.5 through GROUPING SETS, CUBE, and ROLLUP (see Chapter 13, PostgreSQL ’ s Analytics Functions). When combined with materialized views, they become extremely powerful tools for enhancing analytics capabilities.
  • Logical replication plays a major role in enabling analytics with PostgreSQL, as it allows for a replica that is incrementally updated as transactions happen, and the replica can be optimized for analytics workloads, for example, with star models that are automatically generated using materialized views.

Advanced q uerying and r elational a nalysis:

  • PostgreSQL has long supported common table expressions (CTE s) and window functions. Recent additions in version 11 ensured that window functions have complete support for the framing options defined in the SQL standard; version 12 addressed historic performance concerns. Recursive CTEs, materialized CTEs, SEARCH, and CYCLE provide developers with a comprehensive toolset to traverse graphs and analyze networks of relations, such as those found in social networks or bills of materials.

Performance for l arge- s cale a nalytics**:**

  • The block range index (BRIN) was introduced in 9.5 and has undergone numerous improvements, providing developers with a valuable option to index large, sequentially organized datasets without incurring significant indexing overhead.

The analytics features, such as special indexing, materialized views, analytics-optimized replicas, and key SQL constructs for analytics, have enabled the creation of integrated transaction-analytical architectures. AI capabilities complement them to create a true data platform for the modern enterprise.

PostgreSQL has had vector support and, with that, AI support since 2021. The pgvector extension provides a simple and highly effective way to solve the Approximate Nearest Neighbor (ANN) problem, which is central to many AI applications. p gvector has seen significant interest and has matured, as of this writing, to version 0.8.

While pgvector is a cornerstone of its AI support, PostgreSQL’s full capabilities stem from a broader ecosystem of extensions and features. This allows developers to handle diverse AI-related tasks directly within the database, right next to the data:

  • Python is the preferred development language for AI applications, and with PL/Python, PostgreSQL allows running these applications in the context of the database, right next to the data.
  • Apache AGE provides a graph database extension for PostgreSQL and allows developers to combine Cypher (a graph query language) with PostgreSQL and its AI capabilities.
  • Numerous other extensions are available to help with the generation of embeddings and the integration of LLMs. These will be discussed in Part 4, Using PostgreSQL as an AI Platform.

What makes PostgreSQL the (almost) universal database solution today

Section titled “What makes PostgreSQL the (almost) universal database solution today”

PostgreSQL, out of the box, is a very strong solution for most transactional and many analytical workloads, but the full power for AI and advanced analytics use cases is revealed when we dive into PostgreSQL extensions. Some extensions are built-in, meaning they are part of the standard PostgreSQL distribution, such as pg_stat_statememts, pg_trgm, or hstore.

Many others that significantly extend the reach of PostgreSQL have to be installed separately to tailor the database for specific needs, such as:

  • For AI and v ector w orkloads:
    1. pg v ector for vector calculations and approximate nearest neighbor searches
  • For t ime- s eries and a nalytics:
    1. timescaledb provides a hybrid row-columnar store that boosts analytical query performance on time-series and event data
  • For p erformance and m aintenance:
    1. pg_ ivm helps with incremental updates of some materialized views 2. pgsqueeze helps manage bloat in tables 3. pg_ background allows running processes in the background, outside of the transactional context of the initiating transaction

PostgreSQL’s extensibility is key to its success. It was one of the genius design decisions that Stonebraker and the team took over 30 years ago. While PostGIS – the extension for geographic data types – may be the best known one, Postgres has a large ecosystem of extensions, and what is key is that they evolve almost independently of Postgres in their own communities, with their own roadmaps and on their own timelines. Just like Postgres, this is a merit-based ecosystem: the extensions that are widely accepted see rapid development (e.g., pg v ector), while others come and go. Some successful extensions are developed by individuals to meet a specific need, such as pg_background, which is needed to migrate autonomous transactions from Oracle to Postgres.

Extensibility is the foundation of PostgreSQL’s success in analytics and AI, but also its strength in specialty applications, such as IoT, where the timescaledb extension has been very successful. Interestingly enough, this turns Postgres into a true data platform, where one database can serve many use cases – but without resorting to integration pipelines and multiple versions of the same data.

The extensibility, platform independence, rapid innovation, and rich ecosystem are what make Postgres the #1 choice for developers of modern enterprise applications. The fact that Postgres – and its derivatives such as Aurora and AlloyDB – are available on every cloud platform, from Alicould, AWS, Azure, Google, Hetzner, OVH, and Tencent, to StackIt, and every operating system, from BSD, Linux, and macOS, to Solaris and Windows shows that PostgreSQL is a future-proof data platform that provides the developer with maximum freedom and innovation.

As described previously, PostgreSQL is very well-suited to many transactional, analytic, and AI use cases. However, there are situations where an enterprise data platform should integrate PostgreSQL with other specialty solutions.

  • Very large data warehouses, where queries need to be automatically distributed over multiple servers using MPP technology: Often, monolithic data collections exceeding ~200 TB require a specialized solution. Such monoliths can also be redesigned into micro- or mini-services, in which case a Postgres-based solution can be considered. If refactoring is not an option, one should consider using PostgreSQL as a transactional backbone, combined with a PostgreSQL-compatible specialized data warehouse system, such as WarehousePG.
  • Data lakes with large data collections that rely on open table formats (OTF s) stored on very cost-effective object store technologies instead of SSD and other high-speed storage models: Postgres is not designed to work with object stores in read-only mode, but extensions such as pg_duckdb or Citus can be used to access OTF from within Postgres.
  • In-memory caching databases that support complex, high-volume, and low-latency applications: While PostgreSQL has been used effectively to cache and refresh results, specialized solutions such as Redis are often used alongside PostgreSQL. In that case, PostgreSQL is the transactional backbone, and the application cache is managed in Redis.
  • Mobile applications that do not require managing concurrent users, session isolation, or complex transactions often benefit from using simpler solutions on the mobile device, such as SQLite or Realm. The results of the mobile transactions are then integrated into central Postgres solutions for enterprise processing.

While there are use cases and architectures where PostgreSQL is not the ideal standalone solution, we recommend using PostgreSQL in most cases to reduce operational complexity, custom development, and licensing costs. If Postgres itself is not sufficient, we suggest considering some of the highly successful Postgres derivatives, such as EDB Postgres AI, TimescaleDB by TigerData, or Greenplum (or its open source variant, WarehousePG), which are built on Postgres and close the capability gap using proprietary technologies.

This chapter provided a summary of the historical evolution of PostgreSQL, beginning with early research at Berkeley that led to its development as a successor to Ingres. We highlighted some of the fundamental design decisions that contributed to PostgreSQL’s success: extensibility and platform independence.

As the need for new data management capabilities evolved, Postgres kept up by supporting high transaction volumes and new applications, such as geographic information systems and JSONB for document data types. In parallel, new analytics capabilities were added, including materialized views, parallel queries, and new SQL constructs.

Last, but not least, the PostgreSQL ecosystem stepped up in 2021 and introduced pgvector, an extension that handles vector datatypes and provides specialized indexes for nearest-neighbor-based AI processing, an essential building block for GenAI and semantic search.

While PostgreSQL is generally suitable for most applications, the chapter also identified cases where specialized database technologies should be considered alongside PostgreSQL to provide complementary capabilities.