CREATE OR REPLACE FUNCTION add_() RETURNS void AS
$BODY$
declare
foo int;
BEGIN
FOR i IN 1..50 LOOP
foo = i;
RAISE NOTICE 'combination_array(%)', foo ;
UPDATE table_1 set r_id = foo WHERE id = (select id from table_1 where r_id is null order by id limit 1);
END LOOP;
END; $BODY$ LANGUAGE 'plpgsql' ;
SELECT add_();
after this execution when i execute
UPDATE table_1
set r_id = foo
WHERE id = (select id from table_1 where r_id is null order by id limit 1);
END LOOP;
he will be busy, someone will tell me how to clear traction in pgsql
source
share