title: How can I debug this function with v_operation and v_message?
body: <pre><code>CREATE OR REPLACE FUNCTION f_sync_from_xml()
  RETURNS boolean AS
  $BODY$
  DECLARE
  myxml    xml;
  datafile text := 'Documenti/ABBATE_EMANUELE_Lvl1F2Va_20160418-1759.xml';
  BEGIN
  
  myxml := pg_read_file(datafile, 0, 100000000); 
  
  CREATE TABLE tmp AS
  SELECT (xpath('//some_id/text()', x))[1]::text AS id
  FROM   unnest(xpath('/xml/path/to/datum', myxml)) x;
  END;
  $BODY$ language plpgsql;
  
  SELECT * from tmp;
  </code></pre>
  
  <p>This function should allow to transform a XML into postgres table. This function doesn't give an error but not create the table. How can I use v_operation and/or v_message to find possible errors?</p>