pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: paul.kulakov@systematica.ru
Subject: BUG #18059: Unexpected error 25001 in stored procedure
Date: Thu, 17 Aug 2023 14:35:23 +0000
Message-ID: <18059-79c692f036b25346@postgresql.org> (raw)

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.



view thread (5+ messages)  latest in thread

Message-ID: <18059-79c692f036b25346@postgresql.org>
Permalink:  ../18059-79c692f036b25346@postgresql.org/
Also on:    postgresql.org/message-id/18059-79c692f036b25346@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, paul.kulakov@systematica.ru
  Subject: Re: BUG #18059: Unexpected error 25001 in stored procedure
  In-Reply-To: <18059-79c692f036b25346@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox