<p>i'm executing a sql query in my changeset as follow:</p>
<pre><code>&lt;changeSet author=&quot;xxxxx&quot; id=&quot;1682329977552-1&quot; context=&quot;unittest&quot;&gt;
&lt;preConditions onFail=&quot;CONTINUE&quot;&gt;
 &lt;sqlCheck expectedResult=&quot;1&quot;&gt; SELECT COUNT(*) FROM pg_roles WHERE rolname='myuser';&lt;/sqlCheck&gt;
&lt;/preConditions&gt;
    &lt;sqlFile dbms=&quot;!h2, oracle, mysql, postgresql&quot;
             encoding=&quot;UTF-8&quot;
             endDelimiter=&quot;\nGO&quot;
             path=&quot;db_grants.sql&quot;
             relativeToChangelogFile=&quot;true&quot;
             splitStatements=&quot;true&quot;
             stripComments=&quot;true&quot;/&gt;
&lt;/changeSet&gt;
</code></pre>
<p>As you can see, <code>myuser</code> is hardcoded which is not desirable, i'm looking for a way to read that user from environment variables but was wondering if it's even possible.</p>
<p>I'm also using that user in <code>db_grants.sql</code> which grants some accesses to the user:</p>
<pre><code>grant select on all tables in schema public to myuser;
grant insert on all tables in schema public to myuser;
grant delete on all tables in schema public to myuser;
grant update on all tables in schema public to myuser;
</code></pre>
<p>Good to mention that these scripts runs on <strong>openshift</strong> cluster enviroment.</p>

Abolfazl
<p>As written in <a href="https://docs.liquibase.com/concepts/changelogs/property-substitution.html" rel="nofollow noreferrer">property-substitution</a> you can pass properties to the liquibase command CLI with <code>-D</code> prefix (or you can use other method), so something like <code>-Dproperty-name=somevalue</code> and then in your changeSet/sql use it as <code>${property-name}</code>.</p>
<p>cmd: <code>liquibase update -Dpguser=myuser</code></p>
<pre class="lang-xml prettyprint-override"><code>&lt;changeSet author=&quot;xxxxx&quot; id=&quot;1682329977552-1&quot; context=&quot;unittest&quot;&gt;
&lt;preConditions onFail=&quot;CONTINUE&quot;&gt;
 &lt;sqlCheck expectedResult=&quot;1&quot;&gt; SELECT COUNT(*) FROM pg_roles WHERE rolname='${pguser}';&lt;/sqlCheck&gt;
&lt;/preConditions&gt;
    &lt;sqlFile dbms=&quot;!h2, oracle, mysql, postgresql&quot;
             encoding=&quot;UTF-8&quot;
             endDelimiter=&quot;\nGO&quot;
             path=&quot;db_grants.sql&quot;
             relativeToChangelogFile=&quot;true&quot;
             splitStatements=&quot;true&quot;
             stripComments=&quot;true&quot;/&gt;
&lt;/changeSet&gt;
</code></pre>
<pre class="lang-sql prettyprint-override"><code>grant select on all tables in schema public to ${pguser};
grant insert on all tables in schema public to ${pguser};
grant delete on all tables in schema public to ${pguser};
grant update on all tables in schema public to ${pguser};
</code></pre>
