Re: Procedure support improvements
| От | Peter Eisentraut |
|---|---|
| Тема | Re: Procedure support improvements |
| Дата | |
| Msg-id | 99b87249-d08c-8082-340e-84273150b59e@2ndquadrant.com обсуждение исходный текст |
| Ответ на | Re: Procedure support improvements (Laurenz Albe <laurenz.albe@cybertec.at>) |
| Список | pgsql-jdbc |
On 2019-08-26 20:08, Laurenz Albe wrote: > test=> CREATE OR REPLACE PROCEDURE testproc() LANGUAGE plpgsql AS > $$BEGIN PERFORM 42; COMMIT; PERFORM 'x'; END;$$; > CREATE PROCEDURE > test=> CALL testproc(); > CALL > test=> BEGIN; > BEGIN > test=> CALL testproc(); > ERROR: invalid transaction termination > CONTEXT: PL/pgSQL function testproc() line 1 at COMMIT > > Oops. > I find that indeed surprising. > > What is the rationale for this? It's mostly an implementation restriction. You would need to teach SPI_commit() and SPI_rollback() to manipulate the top-level transaction block state appropriately and carefully. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-jdbc по дате отправления: