# Proof of Concept: Restoring PostgreSQL Support for Mautic

**URL:** <https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313>\
**Category:** General Discussion\
**Tags:** discussion, development, mautic-4\
**Created:** [August 13, 2025, 4:23am UTC](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313 "2025-08-13T04:23:44Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![esio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/esio/32/14631_2.png) [@esio](https://forum.mautic.org/u/esio)\
**Post date:** [January 9, 2026, 1:17am UTC](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313/21 "2026-01-09T01:17:37Z")

</div>

Hi.

Great to hear it. PoC git is already based on latest version of 7.x (weekly merged to keep it updated).  
I will begin work on it to make production ready.

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [January 13, 2026, 10:21am UTC](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313/22 "2026-01-13T10:21:51Z")

</div>

Fabulous, please do keep us updated!

I’ve set up an accountability process here:

> **[Implement PostgreSQL support in Mautic via minimal compatibility layer -...](https://community.mautic.org/processes/roadmap/f/43/results/14)**
>
> Lot companies and users cannot use Mautic today because they run PostgreSQL in production (enterprise policy, existing infrastructure, managed platforms such as Supabase, AWS Aurora PostgreSQL, Azure PostgreSQL, etc.). Mautic has been...

---

<div class="post-metadata">

**Author:** ![esio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/esio/32/14631_2.png) [@esio](https://forum.mautic.org/u/esio)\
**Post date:** [January 14, 2026, 1:56am UTC](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313/23 "2026-01-14T01:56:46Z")

</div>

Code itself is almost PR-ready. All existing tests already passed.

 ![Mautic tests and validations](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/696b80900ceaf90741fb1114da6c084d3cded9bd.png)

But there is still some work left todo. Latest code as usual available via the PoC link.

---

<div class="post-metadata">

**Author:** ![esio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/esio/32/14631_2.png) [@esio](https://forum.mautic.org/u/esio)\
**Post date:** [January 29, 2026, 6:13am UTC](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313/24 "2026-01-29T06:13:42Z")

</div>

Update:  
Initially a lot Unit Test failed when running on PostgreSQL.  
Currently around 2% still failing. Mostly due testing environment not work same way comparing to installer and real Mautic itself. Once all of the unit test pass without error PR will be placed.

---

<div class="post-metadata">

**Author:** ![esio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/esio/32/14631_2.png) [@esio](https://forum.mautic.org/u/esio)\
**Post date:** [February 27, 2026, 9:00am UTC](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313/25 "2026-02-27T09:00:38Z")

</div>

Hi everyone.

Quick progress report.

Just ran a full PHPUnit suite on PostgreSQL (PHPUnit 10.5, PHP 8.4, PostgreSQL 18):

 ![Test PSQL](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/2cc587d188e94fd80eef511948ce7b1d65c30f2b.png)

- Total tests: **5546**

- Assertions: ~29 862

- Runtime: ~9:30 min

**Summary:**

- 7 errors

- 9 failures

- 2 warnings

What was done so far:

- **All existing migration files** have been refactored to be fully compatible with PostgreSQL (no more MySQL-specific syntax issues during install/upgrade).

- Where possible, I’ve replaced MySQL-only syntax/expressions in queries with standard SQL equivalents that work identically on both platforms (e.g. using portable functions or CASE instead of proprietary constructs). This reduces platform-specific code even further.

- Several unit/functional tests were adjusted where needed — for example, PostgreSQL doesn’t guarantee the same default sort order as MySQL when no explicit ORDER BY is provided (MySQL often falls back to primary key), so we added explicit ordering in those cases to make assertions reliable across both platforms.

Currently working through the errors and failures in my free time.  
If someone would also like to jump in ping me here.

---

<div class="post-metadata">

**Author:** ![esio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/esio/32/14631_2.png) [@esio](https://forum.mautic.org/u/esio)\
**Post date:** [March 4, 2026, 10:34am UTC](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313/26 "2026-03-04T10:34:44Z")

</div>

Hi all.

Quick progress report.

 ![image_2026-03-03_20-18-42](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/7/714a456da4978769ca7822bd029c6b84f6608419.png)

All the issues have been solved.  
Link to the job action log can find [here](https://github.com/wieslawgolec/mautic/actions/runs/22662181325/job/65688645770).  
200+ files were changed.  
Code itself is working, but may still need some polishing.

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [March 4, 2026, 10:37am UTC](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313/27 "2026-03-04T10:37:49Z")

</div>

Great job @esio!

Can you make a PR so we can review it in mautic/mautic? It is a bit too tight for the 7.1 release as the Release Candidate is about to be shipped, we could stage it for 7.2 though, which will give plenty of time for testing and review.

---

<div class="post-metadata">

**Author:** ![esio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/esio/32/14631_2.png) [@esio](https://forum.mautic.org/u/esio)\
**Post date:** [March 4, 2026, 10:44am UTC](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313/28 "2026-03-04T10:44:44Z")

</div>

Sure. Will do soon. Need first prepare a proper a summary of the changes. Big chunk of the code was changed. This will help to understand why some changes were made.

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [March 4, 2026, 10:58am UTC](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313/29 "2026-03-04T10:58:37Z")

</div>

That would be great - we’ll also do a copilot code review as soon as it comes in as a PR which can be helpful in flagging up any bits which could be problematic.

You can create the PR in draft mode while you write up the PR description, if that helps.

Please be sure to base it on 7.x.

---

<div class="post-metadata">

**Author:** ![esio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/esio/32/14631_2.png) [@esio](https://forum.mautic.org/u/esio)\
**Post date:** [March 4, 2026, 11:07am UTC](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313/30 "2026-03-04T11:07:16Z")

</div>

> [@silavapi](#):
>
> copilot code review

Code is already based on latest commit from 7.x including merge which broke PHPStan baseline job.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/25c5e96de78cebd60e9b0b33a78e4c426f45c1ca.png)

---

<div class="post-metadata">

**Author:** ![esio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/esio/32/14631_2.png) [@esio](https://forum.mautic.org/u/esio)\
**Post date:** [March 4, 2026, 12:06pm UTC](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313/31 "2026-03-04T12:06:09Z")

</div>

draft PR created [here](https://github.com/mautic/mautic/pull/15926).

Best  
WG

[Previous page](https://forum.mautic.org/t/proof-of-concept-restoring-postgresql-support-for-mautic/36313.md?page=1)
