title: remove characters from the strings matching pattern postgresql
body: <p>I have some text elements in the column that have a character &quot;|&quot; and the rest right after it I need to get rid of:</p>
  <pre><code>campaign
  abc
  fdg|3234
  dfr|4567
  </code></pre>
  <p>I want it to look like:</p>
  <pre><code>campaign
  abc
  fdg
  dfr
  </code></pre>
  <p>I tried:</p>
  <pre><code>select replace (data_2_crm.campaign, '_|_', '' ) from data_2_crm
  select trim (trailing '.*|' from campaign) from data_2_crm
  select trim (trailing '%|' from campaign) from data_2_crm
  </code></pre>
  <p>It didn't work. Please help!</p>