0

I would like to read file temp table in a function, like below.

create or replace function test(filepath text)
returns void
as
$$
declare
begin

copy sometable from filepath;

end
$$
language plpgsql; 

Is there any way?

richyen
  • 8,114
  • 4
  • 13
  • 28
kiitosu
  • 117
  • 12

1 Answers1

0

I can do than with execute.

execute format('
    copy sometable from %L with csv;
',filepath);    
richyen
  • 8,114
  • 4
  • 13
  • 28
kiitosu
  • 117
  • 12