BUG #18059: Unexpected error 25001 in stored procedure
The Post Office <noreply@postgresql.org>
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: paul.kulakov@systematica.ru
Date: 2023-08-17T14:35:23Z
Lists: pgsql-bugs, pgsql-hackers
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.
Commits
-
Avoid unnecessary plancache revalidation of utility statements.
- d8b2fcc9d4b5 17.0 landed
- ba0d737caa44 16.0 landed
- b808dbf90582 12.17 landed
- 9c59f3862b18 11.22 landed
- 9b2a41db1cc0 14.10 landed
- 8700851352a8 15.5 landed
- 27566bcf3c87 13.13 landed