Postgres with sqlFile - the operator ? becomes ??

I came across a mystery today. Have been using Liquibase for a few months in a pre-production context, and just ran into this issue.

I’m seeing source code that uses the “?” operator in postgres getting created in the database with that question mark repeated.

for example, this source code
WHERE f.filter_object::JSONB ? 'patient_status';

appears like this when I view the SQL in pgAdmin
WHERE f.filter_object::JSONB ?? 'patient_status';

Is there some setting that may be controlling this translation?
For some context, our changesets use the sqlFile tag, e.g.

<changeSet author="alexey" id="patient_search.test.sql" runOnChange="true">
   <sqlFile dbms="postgresql" endDelimiter=";" path="../../functions/patient_search.test.sql" relativeToChangelogFile="true" splitStatements="false" stripComments="false"/>

Hi @rsredsail ,

I am not a Postgres sql expert and never needed to use the ? operator but was wondering if you could tell me:

  • What error are you getting? I understand there is an extra ? but is liquibase executing the changeset in an unexpected way?
  • What version of Liquibase are you using?

I did find some articles outlining issues using ? in Postgres, perhaps these will help, a bit out of my depth tho: here and here.

I was having the exact same problem and I resolved using an old version of liquibase (3.6.1 in my case). We tried 4.2.2 and 4.3.2 and both don’t work so try rolling back to an older version.

Hope this helps :smiley: