UUID creation for Tables in Postgresql

Tags: #<Tag:0x00007f01c1f22208> #<Tag:0x00007f01c1f220c8>

Hello everyone. Currently I am trying to make OpenMRS run on PostgreSQL. For the creation of uuid’s for all rows of a table, there is an inbuilt function in mysql, oracle as well as postgresql( by making use of uuid-ossp extension). Currently the liquibase changesets in openmrs-core make use of these functions only for mysql and oracle and rest all databases are handled manually via a java class.

So for postgresql should I edit the changesets and make use of in built function ( which can only be used when uuid-ossp extension is added ) or let it be handled by the java class? Making use of java class especially for a large database will be slower but then again for postgresql you need an extension( This extension can be added by running a query just after the creation of database ).

Any advice is welcomed.

So, assuming the target is unreleased versions of the platform or the latest releases (e.g., 2.3.0 and forward or 2.4.0 and forward), I wouldn’t worry about replacing the function to generate a UUID. Those seem to be used when migrating data from pre-2.x to 2.x versions and we have a ticket underway to not run those migrations on newer versions.

1 Like

Ok then it will be better to let it be handled by java class. Thanks for the info @ibacher.