title: How to use "RAISE INFO, RAISE LOG， RAISE DEBUG” to track log in PostgreSQL function?
body: <pre><code>CREATE OR REPLACE FUNCTION mover(src text, dst text, cpquery text, conname text, ifbin boolean) returns void as
  $$
          DECLARE
                  cnt integer;
                  dlcnt integer;
                  del_count integer;
                  ret text;
  
          BEGIN
                  SELECT  pg_catalog.dblink_copy_open(conname, dst, ifbin) INTO ret ;
                  RAISE LOG 'dblink_open %',ret;
  
                  execute 'SELECT  1 as check FROM ' || src ||' limit 1' into cnt;
                  IF cnt=0 THEN
                          PERFORM pg_sleep(2);
                  END IF;
  
                  IF ifbin=true THEN
                          RAISE DEBUG 'Start to Copy data with binary';
                          execute 'COPY (' || cpquery || '  ) to function pg_catalog.dblink_copy_write with binary';
                          RAISE DEBUG 'Finish Copy data';
                  ELSE
                          RAISE DEBUG 'Start to Copy data without binary';
                          execute 'COPY (' || cpquery || '  ) to function pg_catalog.dblink_copy_write';
                          RAISE DEBUG 'Finish Copy data';
                  END IF;
  
                  execute 'DELETE FROM ' || src;
  
                  GET DIAGNOSTICS del_count=ROW_COUNT;
                  RAISE INFO 'DELETE % rows',del_count;
  
                  SELECT  pg_catalog.dblink_copy_end() INTO ret;
                  RAISE LOG 'dblink_end %',ret;
          END;
  $$
  language plpgsql;
  </code></pre>
  
  <p>As code, I want to put some message into log by using <code>RAISE</code>, but where is the location
  of my log file ? and where <code>RAISE DEBUG</code> output?</p>