Hey everyone. I had been trying for some time to make OpenMRS-core run on PostgreSQL. I took some help from Support For PostgreSQL where @teleivo did some work.
Currently in the liquibase changesets where there is any precondition that checks for presence of Foreign Key, Primary Key or Indexes in tables, a precondition error is raised.
I am using PostgreSQL 12.2 with liquibase 2.0.5 currently being used in openmrs-core and have updated the PostgreSQL dependency to 42.2.8 .
Initially I thought It was just with indexes so I ran the changes sets and created the indexes even if the error occurred. But then the same error came with foreign key and primary key preconditions as well.
Without being able to really tell anything, my first suspicion is that our (very old) version of Liquibase doesn’t work with (very new) versions of Postgres. Is it possible to test with last Postgres 9.4 and the 9.4 version of the JDBC driver? Hopefully by the time GSoC starts in earnest, we’ll be closer to getting this merged and can rely on newer versions of things!
The issue finally got resolved with PostgreSQL 9.4 with 9.3-1101-jdbc4 postgresql driver.
One strange thing I observed though was that initially I tried with PostgreSQL 9.6 and with drivers 42.1.4 and 9.4.1212, error appeared randomly after executing certain number of changesets involving index or foreign key or primary key. A change set which might have failed in one execution got executed in another.