Thread: BUG #18059: Unexpected error 25001 in stored procedure
The following bug has been logged on the website: Bug reference: 18059 Logged by: Pavel Kulakov Email address: paul.kulakov@systematica.ru PostgreSQL version: 15.4 Operating system: Debian GNU/Linux 11 Description: Steps to reproduce: 1. Create stored procedure create or replace procedure test_proc() language plpgsql as $procedure$ begin commit; set transaction isolation level repeatable read; -- here follows some useful code which is omitted for brevity end $procedure$; 2. Open new connection 3. Execute the following 3 queries one by one: a) call test_proc(); b) create temporary table "#tmp"(c int) on commit drop; c) call test_proc(); On step c) you'll get an error [25001]: ERROR: SET TRANSACTION ISOLATION LEVEL must be called before any query Where: SQL statement "set transaction isolation level repeatable read" PL/pgSQL function test_proc() line 4 at SQL statement -------------------------------------------- I used 3 different instruments with the same problem everywhere: 1) libpq in my own C++ application 2) DBeaver 3) npgsql in my own C# application The same problem occures on PostgreSQL 14.4 running on Windows 10.