Arguments in favour of PostgreSQL

Arguments in favour of PostgreSQL

by Mario Gharib -
Number of replies: 16

Dear Moodlers, 

I came across this article on Moodle 3.10 that is saying why we should use PostgreSQL  (https://docs.moodle.org/310/en/Arguments_in_favour_of_PostgreSQL).

I just want to ask if this article STILL VALID, since it was last modified on 17 March 2016, at 14:07. 

We're already using PostgreSQL, but there has been a discussion, without going into details here, if we switch to MySQL. So after reading this article, I believe we should stay with PostgreSQL.

So can a Moodle partner confirm this please. Thanks !


Average of ratings: -
In reply to Mario Gharib

Re: Arguments in favour of PostgreSQL

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
MySQL sucsk much less badly than it used to. (When we stared running our Moodle on postgres, the most importnat command to know for managing a MySQL install was repair tables, because it was quite good at corrupting your data. Not a good attribute for a database to have.)

Postgres has always had really good scalability, and is just ultra-reliable at not losing your data.

Choosing either of MySQL (or why not MariaDB to avoid the evil Oracle empire?) or Postgres is not going to be a terrible mistake. Lots of people use both. If you have staff who know how to run one much better than the other, the that might tip the balance in favour of that option. If you are not sure, I would recommend Postgres.
Average of ratings: Useful (3)
In reply to Tim Hunt

Re: Arguments in favour of PostgreSQL

by Mario Gharib -
Thanks TIme for you reply, much appreciate it.
So, the article (https://docs.moodle.org/310/en/Arguments_in_favour_of_PostgreSQL) is no longer valid ?
Average of ratings: Useful (1)
In reply to Mario Gharib

Re: Arguments in favour of PostgreSQL

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I expect it is mostly still valid, but I don't really know.
In reply to Tim Hunt

Re: Arguments in favour of PostgreSQL

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Stalemate!
wink

The article was written in July 2005 and no content changes happened since then: https://docs.moodle.org/310/en/index.php?title=Arguments_in_favour_of_PostgreSQL&action=history.

Either the original author, Przemyslaw Stencel , comes to the rescue or our document fairies take a decision.

In reply to Mario Gharib

Re: Arguments in favour of PostgreSQL

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Not a Moodle Partner but if I may offer my opinion: if there were no other factors then I would recommend MySQL/MariaDB as that's the most widely used thus support is easier to obtain. But if you have PostgreSQL skills available then you should use that.

This answer (and thread) may be helpful.

In reply to Mario Gharib

Re: Arguments in favour of PostgreSQL

by Jerry Lau -
Not moodle specific but I am looking at converting/moving from MySQL to PostGres

https://www.cybertec-postgresql.com/en/why-favor-postgresql-over-mariadb-mysql/
In reply to Jerry Lau

Re: Arguments in favour of PostgreSQL

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

That article is over four years old. For the first example, data type handling, with MariaDB v10.3.27 I get:

MariaDB> INSERT INTO t2 VALUES (1, 1234.5678); 
ERROR 1264 (22003): Out of range value for column 'data' at row 1 

I.e. the same behaviour as PostgreSQL. Same result with MySQL v8.0.21.

This isn't to say you shouldn't migrate to PostgreSQL, but if it's motivated by a comparison with MySQL then hopefully some more recent comparison can be found.

Average of ratings: Useful (2)
In reply to Mario Gharib

Re: Arguments in favour of PostgreSQL

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It's more what you know best. Catalyst is a big Postgres user, so they probably would say that smile
In reply to Mario Gharib

Re: Arguments in favour of PostgreSQL

by Mario Gharib -
Hello everybody,

I recommend a Moodle Partner to remove this article since we haven't get a clear answer if it stills valid or not.
In reply to Mario Gharib

Re: Arguments in favour of PostgreSQL

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
You must understand that some questions don't have Yes/No answers. Still this discussion has a message - the fact that there is no clear answer - and as answers (future) questions of others.

You must also understand that you can't decide on your own a full discussion: You should respect the time spent by the other authors of the posts.

N.B. The forum moderators are not necessarily (working for) Moodle partners. They are a mixed bunch including volunteers from the community. Indeed the whole collection of courses where we meet is called Community support.
In reply to Visvanath Ratnaweera

Re: Arguments in favour of PostgreSQL

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Ok - I see Catalyst mentioned up there and kept meaning to come back.

From Catalyst's current perspective (in 2021) both MySQL and Postgres are viable options for running a large Moodle site and when choosing between those options you need to consider:
* Internal knowledge
* Capabilities of hosting provider (Database as a service etc)

Oracle and Ms SQL should still be avoided as much as possible as the backend database for Moodle - but still ok to use as an external source of data for syncing enrolments/cohorts etc.

I do think it makes sense to delete that document from the 3.11 / 3.10 moodledocs wiki but leave it there in the historical versions - I'll ping someone with the ability to delete pages and ask for that to be done.

  *Edit - I've created MDLSITE-6517 to ask for it to be deleted.
In reply to Mario Gharib

Re: Arguments in favour of PostgreSQL

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Mario

I'm deeply sorry. I misread your request. You're talking about deleting the article in Moodle Docs. I thought you refer to this discussion. My bad.