0

What I've read, it should be possible in Postgresql 14 to add commit in a procedure, but in my case it raises an error. For testing it, I wrote following:

CREATE OR REPLACE PROCEDURE public.committest()
    LANGUAGE plpgsql
AS $procedure$
declare
  test bigint;
    BEGIN
        select id into test from "AUTH".info;
        commit;
    END;
$procedure$
;

Then execute with

call public.committest();

The error message is:

SQL-Fehler [2D000]: ERROR: invalid transaction termination
  Wobei: PL/pgSQL function committest() line 6 at COMMIT

But it's only on the (ubuntu) server. On my local development environment, it is working. So I think, I need to configure something? But I can't find out what I need to configure.

tsschulz
  • 23
  • 4
  • The caller probably already started a transaction. –  Apr 03 '23 at 07:34
  • Unfortunately not. I did the call in psql and dbeaver directly after starting them. And also an application which is calling the functions (and didn't start transactions) get this error. – tsschulz Apr 03 '23 at 08:14

0 Answers0