Proof of Concept: Restoring PostgreSQL Support for Mautic

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.

Fabulous, please do keep us updated!

I’ve set up an accountability process here:

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

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

1 Like

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.

1 Like

Hi everyone.

Quick progress report.

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

  • 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.

Hi all.

Quick progress report.

All the issues have been solved.
Link to the job action log can find here.
200+ files were changed.
Code itself is working, but may still need some polishing.

1 Like

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.

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.

1 Like

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.

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

1 Like

draft PR created here.

Best
WG