Patient Management in PostgreSQL

Hello everyone. I am currently running OpenMRS core on PostgreSQL with legacyUI and was going through the Patient Management section in Admin section. Everything works fine except when deleting a patient. When I am deleting the Patient forever I get a foreign key constraint error in table Patient.

ERROR: update or delete on table "person" violates foreign key constraint "person_id_for_patient" on table "patient"

Here is the link to the logs - https://pastebin.com/HF1P1Duu .

So I went through the database and saw that onDelete=CASCADE was not set in PostgreSQL for table patient. Then I crosschecked functionality with MySQL , there we can delete the patient even though it has onDelete=RESTRICT set.

My doubt is that there should have been an exception raised in MySQL as well, as is raised in PostgreSQL. How is that the Patient gets deleted successfully in MySQL even though onDelete=CASCADE is not set up? I went through the purge method but I couldn’t figure out the problem.