Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
src/pl/plpgsql/src/sql/plpgsql_trap.sql
@@ -85,13 +85,11 @@
create function trap_timeout() returns void as $$
begin
  declare x int;
  begin
    -- we assume this will take longer than 1 second:
    select count(*) into x from generate_series(1, 1_000_000_000_000);
    perform pg_sleep(10);
  exception
    when others then
      raise notice 'caught others?';
      raise notice 'caught others: %', sqlerrm;
    when query_canceled then
      raise notice 'nyeah nyeah, can''t stop me';
  end;