title: xpath (unknown, character varying) does not exist
body: <p>I'm trying to get some data out of a PostgreSQL table incidents_data</p>
  <pre class="lang-none prettyprint-override"><code>                              Table public.incidents_data
    Column   |          Type           | Modifiers | Storage  | Stats target | Description
  -----------+-------------------------+-----------+----------+--------------+-------------
   mib_name  | character varying(64)   |           | extended |              |
   timestamp | bigint                  | not null  | plain    |              |
   node_id   | bigint                  | not null  | plain    |              |
   id        | bigint                  | not null  | plain    |              |
   xml_data  | character varying(4096) |           | extended |              |
   cause     | character varying(128)  |           | extended |              |
  </code></pre>
  <p>The data is in column xml_data with the following XML layout.</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;Incident&gt;
  &lt;ExtraInformation&gt;
  &lt;SslState&gt;error&lt;/SslState&gt;
  &lt;RemoteLocalTuple&gt;Remote Ip:Port 1.1.1.1:46537  &amp;lt;---&amp;gt;  Local Ip:Port 2.2.2.2:5061&lt;/RemoteLocalTuple&gt;
  &lt;/ExtraInformation&gt;
  &lt;StandardInfo&gt;
  &lt;Cause&gt;error:14094415:SSL routines:ssl3_read_bytes:sslv3 alert certificate expired&lt;/Cause&gt;
  &lt;MIBName&gt;ipcsTlsHandshakeFailure&lt;/MIBName&gt;
  &lt;Timestamp&gt;1594933477674&lt;/Timestamp&gt;
  &lt;IncidenceId&gt;797466738837365&lt;/IncidenceId&gt;
  &lt;Source&gt;source-server&lt;/Source&gt;
  &lt;/StandardInfo&gt;
  &lt;/Incident&gt;
  </code></pre>
  <p>Trying to get the RemoteLocalTuple data using xpath like below.</p>
  <pre><code>select xpath('/mydefns:Incident/mydefns:ExtraInformation/mydefbs:RemoteLocalTuple', xml_data) from incidents_data where mib_name='ipcsTlsHandshakeFailure';
  
  select xpath('//Incidents/ExtraInformation/RemoteLocalTuple/text()',xml_data) from incidents_data where mib_name='ipcsTlsHandshakeFailure';
  </code></pre>
  <p>I get a error on the xpath command.</p>
  <blockquote>
  <p>ERROR:  function xpath(unknown, character varying) does not exist<br>
  HINT:  No function matches the given name and argument types. You might need to add explicit type casts.</p>
  </blockquote>
  <p>The server is running psql (PostgreSQL) 9.4.21 and the libxml2 library is installed on the server.</p>
  <p>Am I using the xpath function the wrong way?</p>