B is record type and you can't insert a record into a field. You must rewrite your code like this: FOR b IN SELECT MIN(total) as mintotal from results LOOP INSERT INTO orla(total) VALUES(b.mintotal); END LOOP; DAQ
pgsql-sql by date:
Соглашаюсь с условиями обработки персональных данных