Hello,
We have two different A12 services running on the same PostgreSQL database in two different schemas. The second service can’t start because there is an issue with the changesets.
ChangeSet “database/schema/37.0.0/model.xml::A12S-5099” tries to create an extension “pg_trgm” that already exists, and Liquibase throws an exception, stopping the service from starting.
ChangeSet “database/schema/37.0.0/model.xml::A12S-5425” tries to create an index using “gist_trgm_ops”, which is not available.
There are also errors with dropping indexes that should have been created but failed.
I have attached a detailed exception stack trace. Is running two services in one PostgreSQL database, but in separate schemas, not supported? What can we do to get both services running, ideally from the initial startup?
Kind regards,
Simon
2026-08-03T091807.108528584Z liquib.txt (54.7 KB)
Hello Simon,
This is a known bug in changeset A12S-5099. The statement CREATE EXTENSION PG_TRGM (without IF NOT EXISTS) fails when the extension was already created by the first service, since PostgreSQL extensions are database-wide. This aborts the entire transaction, so the indexes are never created, which then cascades into failures in A12S-5425 and A12S-5321-prepare-indexes.
We will fix this by changing the statement to CREATE EXTENSION IF NOT EXISTS PG_TRGM in an upcoming release.
Thanks for the reply. Is there a recommended fix we can do right now until the statement is fixed?
Hi Simon,
Yes, here’s what you can do right now:
-
Ensure public is in the JDBC search path for the second service so that pg_trgm operator classes are accessible:
jdbc:postgresql://host:5432/dbname?currentSchema=teilnehmer,public
-
Clean up the failed state and manually create the missing indexes:
SET search_path TO teilnehmer, public;
---- Remove partial changelog entries
DELETE FROM teilnehmer.databasechangelog
WHERE id IN (‘A12S-5099’, ‘A12S-5425’, ‘A12S-5321-prepare-indexes’);
----- Create indexes that A12S-5099 should have created
CREATE INDEX IF NOT EXISTS IDX_SUBSTRING_MATCH_INSENSITIVE
ON DOCUMENT_FIELDS USING GIST (LOWER(VALUE) GIST_TRGM_OPS);
CREATE INDEX IF NOT EXISTS IDX_VALUE_TEXT_MATCH
ON DOCUMENT_FIELDS USING GIN (to_tsvector(‘simple’, VALUE));
CREATE INDEX IF NOT EXISTS IDX_VALUE_INSENSITIVE
ON DOCUMENT_FIELDS USING HASH (LOWER(VALUE));
-
Restart the second service.
Step 1 is critical — without public in the path, the pg_trgm operator classes won’t be found even after a restart.
Kind regards