Postgres Functions and Question Marks

Issue: Liquibase adds a second “?” in functions when a single “?” is present.
I heard that we could use ?? to escape ?, and it seems like Liquibase is now doing this automatically but it seems something has changed as the functions are now being created with ?? and fail to execute. I thought at one point it was working. (?? in changeset created functions with single ?).
DB: Postgresql latest / 12

Anyone solve this issue recently?

<databaseChangeLog 
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.10.xsd ">

    <changeSet  author="test"  id="1">  
        <sql endDelimiter="/">
CREATE FUNCTION public.x()
    RETURNS void
    LANGUAGE 'plpgsql'
AS $BODY$
BEGIN
INSERT INTO test (results)
SELECT '{"a":1, "b":2}'::jsonb ? 'b';
END;
$BODY$;
/
        </sql>
    </changeSet>
</databaseChangeLog>

Hi @bran ,

Could you provide the complete log output (please use logLevel=DEBUG) of the liquibase updateSQL command. Would love to see what liquibase is creating from the changeset above.

Thanks,

Ronak

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.