title: I want to have my pl/pgsql script output to the screen
body: <p>I have the following script that I want output to the screen from. </p>
  
  <pre><code>CREATE OR REPLACE FUNCTION randomnametest() RETURNS integer AS $$
  DECLARE
      rec RECORD;
  BEGIN
      FOR rec IN SELECT * FROM my_table LOOP
          SELECT levenshtein('mystring',lower('rec.Name')) ORDER BY levenshtein;
      END LOOP;
  
      RETURN 1;
  END;
  $$ LANGUAGE plpgsql;
  </code></pre>
  
  <p>I want to get the output of the levenshein() function in a table along with the rec.Name. How would I do that? Also, it is giving me an error about the line where I call levenshtein(), saying that I should use perform instead. </p>