title: Cursor in PL/pgSQL
body: <p>I want to use a cursor inside the function but then I have a error about definition of one variable, take a look and help please :)</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION curson_func (
  start_date timestamp,
  end_date timestamp)
  RETURNS SETOF integer AS $$
  
  DECLARE
  level_cursor CURSOR FOR 
  SELECT
      login_event.player_id,
      registration.country_id
  FROM
      "fish-tsg".registration
  LEFT JOIN
      "fish-tsg".login_event USING (player_id)
  WHERE
      ts &gt;= start_date AND ts &lt;= end_date ;
  
  level_cursor_row "fish-tsg".login_event%ROW_TYPE;
  
  BEGIN 
  OPEN level_cursor;
  LOOP FETCH level_cursor INTO level_cursor_row;
  EXIT WHEN level_cursor_row = null;
  END LOOP;
  CLOSE level_cursor;
  
  RETURN level_cursor_row;
  
  END $$
  LANGUAGE 'plpgsql';
  </code></pre>
  
  <p>And error that I got: </p>
  
  <pre><code>ERROR:  invalid type name ""fish-tsg".login_event%ROW_TYPE"
  LINE 20: level_cursor_row "fish-tsg".login_event%ROW_TYPE;
  </code></pre>