title: PostgreSQL 12 `quote_literal` function explanation
body: <p>I want to understand how <code>quote_literal()</code> function works.</p>
  
  <p>This is my table:</p>
  
  <pre><code>CREATE TABLE temp_emp (
      id integer,
      name text
  );
  
  INSERT INTO TEMP_EMP (id, name) VALUES (1, 'Super Pavel');
  </code></pre>
  
  <p>When I do:</p>
  
  <pre><code>SELECT * FROM "public".temp_emp WHERE name like '%Pavel%';
  </code></pre>
  
  <p>I have 1 row in result.</p>
  
  <p>However, when I do:</p>
  
  <pre><code>SELECT * FROM "public".temp_emp WHERE name like quote_literal('%Pavel%');
  </code></pre>
  
  <p>I have 0 rows in result.</p>
  
  <p>At the same time:</p>
  
  <pre><code>SELECT * FROM quote_literal('%Pavel%');
  </code></pre>
  
  <p>returns <code>'%Pavel%'</code>.</p>
  
  <p>Could anyone explain why <code>like '%Pavel%'</code> and <code>like quote_literal('%Pavel%')</code> give different results?</p>