6

What would be the strongest reasons for running Drupal on PostgreSQL, in terms of available features and performance? I.e. what postgres features of that are supported by Drupal are not available on mysql? For example, postgres is known for ACID conformance and transactions; does Drupal core take advantage of these or other features in any way?

This question is not about which is a better DB in general, rather whether there are any specific reasons why one might choose postgres over mysql. One obvious trade-off is that many contrib modules will be buggy running on postgres.

I am working with D6, but feel free to direct answers to any major version.

  • 4
    Given that we have a DB-abstraction layer that attempts to even this out, and any contrib modules should be taking advantage of that, I expect the differences to be somewhere between small to none. – Letharion Jul 23 '12 at 18:37
  • 2
    Keep in mind that Postgres became a first class citizen in Drupal 7. Using Postgres with Drupal 6 has always been unwise at best, since the DB abstraction layer was thin, and contrib didn't care much. – Bojan Zivanovic Jul 23 '12 at 23:27
  • I'm afraid this question might encourage fight between Postgresql users and MySQL users. Drupal 7 abstraction layer pretty much remove features not existing in other rdbms, so feature-wise it's levelled on the bottom side. And performance was always a matter of who tested it and what he wanted to prove ;) – Mołot Jun 21 '13 at 14:34
  • The question was asked almost a year ago. How much fighting are your concerned about? Regardless of abstraction layer, the 2 DBs do have some different features that a module could incorporate, e.g. bugs.mysql.com/bug.php?id=18003, and that was the point of the question. – ted.strauss Jun 21 '13 at 14:57
7

Personally, I think the only reason for choosing PostgreSQL over MySQL is if you (or your client) is already a PostgreSQL shop and have DBAs that know PostgreSQL well and know the ins-and-outs of babysitting it. I would also say the same also applies for choosing MySQL over PostgreSQL, assuming you aren't using any contrib modules with MySQL-only functions in them.

  • Now - that's ridiculous. There's only one reason to run MySQL: that's when you want a very fast system, and don't give a damn about sacrificing referential integrity and data quality, and SQLite doesn't cut it. Also, possibly when you don't want to see error messages when you do something wrong - but that's not a good thing either. For all other usage cases => PostgreSQL - because that's actually a working acid-compliant RDBMS. – Quandary Nov 2 '17 at 17:13
2

Some of our clients insist on using PostgreSQL because that's the only database they can support in house.

After implementing a couple of complex Drupal projects using Postgres I would say Postgres is generally faster and I would consider it if the site needs lots of rather complex views. MySQL has only one join algorithm (nested loop) whereas Postgres provides a few so when Views have lots JOINs Postgres may be more advantageous. This is more true if those views also have lots of exposed filters. However Views (both 2.x and 3.x) may experience issues with Postgres that some views with DISTINCT may not work very well if at all.

At the end of the day, if your client insists on using Postgres, and/or performance is a priority, give it a shot but be very cautious that some popular modules or some features may not function well. Or stick with MySQL if you don't have an appetite for risk.

1

Personally, I am using Drupal on Postgres because I need the PostGIS extension, but I reckon this is not a need many applications have.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.