---
title: PostgreSQL for AI applications
description: PostgreSQL, a proven and well-loved database that has become a strong
  choice to support AI. Learn more about how it empowers AI applications!
url: https://canonical.com/blog/postgresql-ai-application?format=md
---

1. [Blog](https://canonical.com/blog)
2. Article

---

[Andreea Munteanu](https://canonical.com/blog/author/munteanuandreea "More about Andreea Munteanu")

5 March 2024

# PostgreSQL for AI applications

---

Share the article

If you’re working with AI, you’re working with data.  From numerical data to videos or images, regardless of your industry or use case, every AI project depends on data in some form. The question is: how can you efficiently store that data and use it when building your models? One answer is PostgreSQL, a proven and [well-loved database](https://db-engines.com/en/blog_post/106) that, thanks to recent developments, has become a strong choice to support AI.

## Why PostgreSQL?

[PostgreSQL](https://www.postgresql.org/) is an open-source, highly capable database system that supports different features like foreign keys, subqueries, triggers, and different user-defined types and functions. In recent years, PostgreSQL enjoyed large popularity in the database landscape, winning database management system (DBMS) of the year in 2023.

PostgreSQL has applications across all industries, such as  finops and e-commerce. It also fits a variety of workloads like online transaction processing, analytics and geospatial data. The solution’s widespread adoption has led to the development of new extensions and libraries for many specific use cases –including machine learning.

[Watch our webinar about PostgreSQL for AI Applications]

[Watch our webinar about PostgreSQL for AI Applications](https://ubuntu.com/engage/postgres-ai-applications)

## PostgreSQL for AI applications

PostgreSQL has more than [1000 extensions](https://gist.github.com/joelonsql/e5aa27f8cc9bd22b8999b7de8aee9d47). They are add-on modules that deliver additional capabilities on top of those found in the core Postgres system. From handling of geospatial data to transforming PostgreSQL to  a vector database, various enhancements are available. The capabilities of the extensions cover a wide range, including analytics and search.

The flexibility and breadth of features that these extensions provide unlock the tremendous potential to enhance your AI projects.

Some of the most relevant extensions for AI:

* [Pgvector](https://github.com/pgvector/pgvector) is an open-source vector similarity search for PostgreSQL. It can be used also for storing embeddings. Due to its capabilities, it enables the database to work as a vector database, similar to OpenSearch.
* [Hydra](https://github.com/hydradatabase/hydra) is an open source columnar database. It enables efficient queries in billions of rows instantly without code changes. It is helpful when ML projects need to process large amounts of data.
* [PostgresML](https://postgresml.org/) is a complete MLOps platform in a PostgreSQL extension. It enables organisations to build models inside the database.

## Role of PostgreSQL in MLOps

[MLOps](https://ubuntu.com/blog/what-is-mlops) is DevOps for machine learning. MLOps platforms such as [Kubeflow](https://ubuntu.com/ai/what-is-kubeflow) ingest data from different types of databases, including PostgreSQL. Additionally, they use databases to store part of their artefacts, including metadata spanning experiments, jobs, pipeline runs and single scalar metrics. Kubeflow and your database need to be reliable and seamlessly integrated, since their availability influences the ability to run ML projects in production.

PostgreSQL is a great database to use alongside Kubeflow, but that doesn’t mean it’s the best choice in every scenario. In practice there are also other viable options, for instance MySQL. When choosing which database you’ll use, prioritise the solution that makes the most sense for your organisation:

* **Existing database –** if you already use a particular database, for example MySQL, within your MLOps platform, then changing it to PostgreSQL might be an unnecessary overhead.
* **Skillset –** Choose a database that aligns with the skills and experience of your teams. If you already have experience working with PostgreSQL, choosing it for this use case would be preferable.

There are other considerations about MySQL and PostgreSQL that you can read about in this [whitepaper](https://ubuntu.com/engage/postgresql-mysql).

## Charmed PostgreSQL for AI applications

The Charmed PostgreSQL Operator delivers automated operations management from day 0 to day 2 on the [PostgreSQL Database Management System](https://www.postgresql.org/). It is an open source, end-to-end, production-ready data platform on top of [Juju](https://juju.is/). It comes in two flavours to deploy and operate PostgreSQL on physical/virtual machines and Kubernetes. Both offer features such as replication, TLS, password rotation, and easy-to-use integration with applications.

The Charmed PostgreSQL Operator meets the need for deploying PostgreSQL in a structured and consistent manner while allowing the user flexibility in configuration. It simplifies deployment, scaling, configuration and management of PostgreSQL in production at scale in a reliable way. PostgreSQL on its own is a great choice for AI projects, and the Charmed Operator takes it to the next level, making it even easier to store your data and build ML models.

### Further reading

[AI in 2024 – What does the future hold?](https://canonical.com/blog/ai-in-2024)

[PostgreSQL high availability made charmingly easy](https://canonical.com/blog/postgresql-high-availability)

[MLOps toolkit whitepaper](https://ubuntu.com/engage/mlops-toolkit)

[Get in touch

Interested in running Ubuntu in your organization?](https://ubuntu.com/about/contact-us/form)

## Sign up for our newsletter

Get the latest Canonical news and updates in your inbox.

Work email:

\*I agree to receive information about Canonical's
products and services.

By submitting this form, I confirm that I have read and agree to [Canonical's Privacy Policy](https://canonical.com/legal/dataprivacy).

Sign up

## Share on

---

## Related posts

[### Canonical joins the Open Secure AI Alliance](https://canonical.com/blog/open-secure-ai-alliance)

Canonical is now part of the Open Secure AI Alliance, announced by NVIDIA with partners across cloud computing, cybersecurity, enterprise software, open source foundations, and...

[Canonical](https://canonical.com/blog/author/canonical)

28 August 2026

[### Arduino® VENTUNO™ Q is available for pre-order with Ubuntu pre-installed](https://canonical.com/blog/arduino-ventuno-q-is-available-for-pre-order-with-ubuntu-pre-installed)

London, UK – August 25, 2026 – Following our initial collaboration announcement in March 2026, Canonical and Arduino (a subsidiary of Qualcomm Technologies, Inc.) are excited...

[Canonical](https://canonical.com/blog/author/canonical)

25 August 2026

[### Advantech AOM-2721 is now Ubuntu Certified](https://canonical.com/blog/advantech-aom-2721-ubuntu-certified)

Canonical announces that the Advantech AOM-2721 is officially joining the list of Ubuntu Certified Hardware.

[Mikhail Khazov](https://canonical.com/blog/author/khazov-m)

13 August 2026

[### Canonical integrates NVIDIA Nemotron 3.5 Lightning with Ubuntu for always-on AI agents](https://canonical.com/blog/nvidia-nemotron-3-5-lightning)

Canonical is pleased to announce that NVIDIA’s newly introduced NVIDIA Nemotron 3.5 Lightning, an open, customizable model built for always-on AI agents, is now available on...

[Canonical](https://canonical.com/blog/author/canonical)

11 August 2026
