New answers tagged plpgsql
The immediate cause of the infinite loop is this. Per documentation: Note in particular that EXECUTE changes the output of GET DIAGNOSTICS, but does not change FOUND. But there's more: CREATE FUNCTION upsert(_ins text, _upd text) RETURNS int AS $func$ DECLARE loop_ct int := 0; row_ct int; BEGIN LOOP IF loop_ct > 1 THEN -- terminate ...
Top 50 recent answers are included