Is there any more to this story? Is this what happens when you have a 'clean' working copy of 3.9 and try to upgrade? What I'm getting at is that there was no previous failed upgrade or similar?
It's a straight forward upgrade. Created new moodle folder and uploaded code, changed config.php to point to correct database, added theme KLASS (in theme folder) and CUSTOMCERT (in mod folder) opened the site, all goes great no problems until the final update screen and when pressed continue, this pops up.
The name of that table is odd: mdl_paygw_paypal. Moodle core doen't have such a table. The final line of the error message, "call to upgrade_noncore()" supports this.
The only way it can already exist is if it's already been created (obviously) which would imply the upgrade script being run twice. The usual reason for that is restarting after failure.
Well I updated to version 3.9.3, no problems at all. Then started the upgrade from 3.9.3 to 3.10+ and got the following again:
To expand on what Howard said: payment gateways were introduced in Moodle 3.10 so the table mdl_paygw_paypal should not exist in the Moodle 3.9 site's database. You can check if it exists with the SQL query:
SHOW TABLES LIKE 'mdl_paygw_paypal';
Nothing should be returned. If this table does already exist you can remove it with DROP TABLE mdl_paygw_paypal (always make a backup of the database before making changes like this).
This kind of problem normally happens if an attempted upgrade has been rolled back to the previous version. The default behaviour when MySQL or MariaDB restores a database is to leave any new tables in place, resulting in this Moodle upgrade error because the table is unexpected.
Thank you for your assistance, I located mdl_paygw_paypal in the sql. I dropped the line, started again from 3.9.3 to 3.10+ and it worked perfectly. All good now.
Thanks once again.