2 ms·
You can't write this in any random function that you don't know who will call: do $$ begin transaction; update page set change_count = change_count + 1 where
by marcosdumay 3y ago
You can't write this in any random function that you don't know who will call:
do $$
begin transaction;
update page set change_count = change_count + 1 where page_id = 1;
if (select change_count = 100 from page where page_id = 1) then
rollback;
else
commit;
end if;
$$