ERROR: function cannot execute on segment because it accesses relation

Cause

GPDB doesn't support running functions at the segment node directly. Running SQL as shown below will trigger this error :

Insert into xxx select * from function_name();create table xxxx as select * from function_name();BEGINFOR r IN SELECT * FROM gp_toolkit.gp_size_of_table_uncompressed where sotutablename like '%archive%'LOOP