postgres. plpgsql stack depth limit exceeded
问题 im working on a simple function where it automatically updates something from a table. create or replace function total() returns void as $$ declare sum int; begin sum = (SELECT count(copy_id) FROM copies); update totalbooks set all_books = sum where num = 1; end; $$ language plpgsql; if i execute "select total();" it works perfectly fine so i made a function trigger so that it automatically updates: create or replace function total1() returns trigger as $$ begin perform (select total());