title: Relation does not exist PLPGSQL
body: <p>I am trying to create a view inside the function using plpgsql which returns the x column of the "small" table which is defined as (x integer,y integer).</p>
  
  <pre><code>create or replace function skyline_naive2(dataset text) returns setof integer as
  $$
  declare 
      fullx text;
  begin
      fullx = dataset||'_skyline_naive2';
      execute format('create view %s as select x,y from %s',fullx,dataset);
      return query select x from fullx;
  end
  $$ language plpgsql;
  
  select * from skyline_naive2('small');
  </code></pre>
  
  <p>It returns <strong>"relation fullx does not exist"</strong></p>
  
  <p>I understand that it is because there is no fullx relation, but I want to call the view using the variable name.</p>
  
  <p>Any help will be </p>