PostgreSQL or MySQL: which one for your project

If you are installing WordPress, Joomla, PrestaShop or another ready-made application, use MySQL (here, MariaDB): that is what those applications were written for. If you are writing your own application, or the program you picked asks for it (as many automation tools and APIs do), PostgreSQL is a good choice. Both exist on shared hosting: MariaDB 10.11.16 and PostgreSQL 13.23.

The right question is not “which is better”. It is “what does my program support?”. The answer is usually on the first page of its documentation.

Quick comparison

Aspect MySQL / MariaDB PostgreSQL
Who uses it WordPress, Joomla, PrestaShop, OpenCart and most CMSs. Applications built by developers, tools like n8n and Evolution API (they accept it), and many new projects.
In cPanel MySQL Databases and phpMyAdmin. PostgreSQL Databases.
Connecting from PHP Works out of the box (mysqli, PDO). Needs the pgsql module switched on in “Select PHP Version”.
Data types and functions Covers everyday use well. Richer (for example, types for semi-structured data), useful in demanding applications.
Tools and tutorials A great many, especially for websites. Plenty, especially for developers.
Connecting from outside SSH tunnel. SSH tunnel.

How to decide

1 Does the program decide for you? If it supports only one, you are done. That is the case for most CMSs.
2 Writing your own code? Pick what your team already knows. Knowing a tool well is worth more than the gap between the two.
3 Using a ready-made service (n8n, Evolution API)? See what the project’s documentation recommends. Many accept both. In that case the database runs on a VPS of yours and the choice is yours.
Do not switch engines halfway. Moving an application from MySQL to PostgreSQL, or the reverse, is not copying a file: it means migrating types, syntax and queries. Choose at the start and change only for a strong reason.

Three questions that usually decide it

Where will it run? On shared hosting both exist; on a VPS you pick whichever you like and install it, and the maintenance is yours. Who will maintain it? If only one person on the team knows how to look after one of the two, that is the one. Do you need something specific? If the project’s documentation asks for a PostgreSQL extension, that is a VPS matter, because on a shared account the server’s extensions are not yours to install. When none of the three settles it, MariaDB is the default for websites, and PostgreSQL the default for developers.

To start experimenting, a shared account is enough. When the project needs more control (installing versions, extensions or services), move to a VPS, where installing and maintaining are yours. See shared hosting or VPS.

Unsure which of the two your application accepts? Tell us its name and we will read the documentation with you.

Open a support ticket

SEE ALSO

MySQL or MariaDB: which one runs here, and does it matter

PostgreSQL in cPanel: creating a database and connecting from PHP

Shared hosting vs VPS: which one does your project need?

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $6.59/mo (3-year plan, with coupon)

See plans
  • 0 Users Found This Useful
Was this answer helpful?