<p>The field <code>employeeData</code> is of type <code>json</code>.</p>
<p>Consider the query:</p>
<pre><code>select * FROM &quot;employees&quot; where employeeData::text like '%someSampleHere%'
</code></pre>
<p>When I'm running the query inside Postgres it works perfect and I get the rows that I'm asking for.</p>
<p>However when I use it with KubeCTL and running this query outside of the PG App</p>
<pre><code>psql -d employess_db -U postgres -c 'select * FROM &quot;employees&quot; where employeeData::text like 'someSampleHere';'
</code></pre>
<p>PG throws</p>
<pre><code>ERROR:  syntax error at or near &quot;%&quot;
LINE 1: select * FROM &quot;employees&quot; where employeeData::text like %someSampleHere%;
</code></pre>
<p>How can we fix it ?</p>

JAN
<p>Sounds like a quoting problem to me. You neglected to show your actual <code>kubectl</code> command line in your question, but this works for me without any errors:</p>
<pre><code>kubectl exec postgres-pod -- psql -U postgres -d employees_db \
  -c &quot;select * from \&quot;employees\&quot; where employeeData::text like '%someSampleHere%'&quot;
</code></pre>
