Функция plpgsql с курсором по таблице geo_objects.
CREATE OR REPLACE FUNCTION test_cursor() RETURNS void AS $$ DECLARE rec record; BEGIN FOR rec IN SELECT * FROM geo_objects LOOP RAISE NOTICE 'id = %, name = %', rec.id, rec.name; END LOOP; END; $$ LANGUAGE plpgsql;