a plpgsql bug

Поиск
Список
Период
Сортировка
От daidewei@highgo.com
Тема a plpgsql bug
Дата
Msg-id 202309191058550158453@highgo.com
обсуждение исходный текст
Ответы Re: a plpgsql bug  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
hello!
    I found a problem in plpgsql. When there is a large loop in plpgsql, it is found that the change of search_path will cause memory exhaustion and thus disconnect the connection.
  The test examples are as follows:

1 create a schema
create schema test_schema;
2 create a function create or replace function test_schema.test_f(id integer) returns integer as $$ declare var2 integer := 1; begin if id % 4 = 1 then return var2 + 2; elseif id % 4 = 2 then return var2 + 3; elseif id % 4 = 3 then return var2 + 4; else return var2; end if; end; $$ language plpgsql;
3 a loop in plpgsql,which wil result disconnection. do $$ declare var1 integer; begin for id in 1 .. 10000000 LOOP set search_path to test_schema; var1 = test_schema.test_f(id); set search_path to public; var1 = test_schema.test_f(id); end loop; end; $$ language plpgsql;



daidewei@highgo.com
Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #18070: Assertion failed when processing error from plpy's iterator
Следующее
От: Philip Muturura
Дата:
Сообщение: Re: Installing PostgreSQL 16 on FreeBSD 13.0