pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: Greg Nancarrow <gregn4422@gmail.com>
Cc: David Rader <david.rader@gmail.com>
Cc: pgsql-jdbc@lists.postgresql.org
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Procedure support improvements
Date: Mon, 26 Aug 2019 14:14:50 -0400
Message-ID: <9461.1566843290@sss.pgh.pa.us> (raw)
In-Reply-To: <1fc1729ff4c1d342b32d0c0fb69df581f02356b1.camel@cybertec.at>
References: <CAOcA-58PFqVxri+C9rZjfG1omtXcdeEWRuY2LaS6igJ7o+4UXw@mail.gmail.com>
	<CAJcOf-dPruhYkyeHmUNU8BCpJxOzSZL+yYpQ=sXac1pGETb7AA@mail.gmail.com>
	<CADK3HHKhbUQey2-XKARdK2Uyx29QLcj1Es+4qGpWqVz+FfuCgw@mail.gmail.com>
	<CAJcOf-eyv_et=Z2WhcFdZLGD-BpH4DyOKH=VZn__L0EKmHbMJQ@mail.gmail.com>
	<CADK3HH+EVnWCS3ynqey8jh=b+WOriH=Jv44yKSun3JrBfKtiZQ@mail.gmail.com>
	<CAJcOf-fEHe9UCvsFXfiizeNUOjHu=WbzkzHM_Yi0Xs4=U8Gnng@mail.gmail.com>
	<CADK3HHKoJ_1FYpqH-3v4rKJD+qp4UEjOE0_e8yXeekNDiD7a1w@mail.gmail.com>
	<2f6ef24a2fae2b42efbf9db3194392dee476f2e5.camel@cybertec.at>
	<CADK3HH+Bfat=byMsatf9VZ2VcG7Geu7=QJBSbJ8cTeE=sqtkAw@mail.gmail.com>
	<1fc1729ff4c1d342b32d0c0fb69df581f02356b1.camel@cybertec.at>

Laurenz Albe <laurenz.albe@cybertec.at> writes:
> Dave Cramer wrote:
> test=> BEGIN;
> BEGIN
> test=> CALL testproc();
> ERROR:  invalid transaction termination
> CONTEXT:  PL/pgSQL function testproc() line 1 at COMMIT

> What is the rationale for this?

A procedure shouldn't be able to force commit of the surrounding
transaction.

As Dave noted, what would be nicer is for procedures to be able
to start and commit autonomous transactions, without affecting
the state of the outer transaction.  We haven't got that though,
and it looks like a lot of work to get there.

			regards, tom lane





view thread (17+ messages)  latest in thread

Message-ID: <9461.1566843290@sss.pgh.pa.us>
Permalink:  ../9461.1566843290@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9461.1566843290@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, pg@fastcrypt.com, gregn4422@gmail.com, david.rader@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Procedure support improvements
  In-Reply-To: <9461.1566843290@sss.pgh.pa.us>
  References: <CAOcA-58PFqVxri+C9rZjfG1omtXcdeEWRuY2LaS6igJ7o+4UXw@mail.gmail.com> <CAJcOf-dPruhYkyeHmUNU8BCpJxOzSZL+yYpQ=sXac1pGETb7AA@mail.gmail.com> <CADK3HHKhbUQey2-XKARdK2Uyx29QLcj1Es+4qGpWqVz+FfuCgw@mail.gmail.com> <CAJcOf-eyv_et=Z2WhcFdZLGD-BpH4DyOKH=VZn__L0EKmHbMJQ@mail.gmail.com> <CADK3HH+EVnWCS3ynqey8jh=b+WOriH=Jv44yKSun3JrBfKtiZQ@mail.gmail.com> <CAJcOf-fEHe9UCvsFXfiizeNUOjHu=WbzkzHM_Yi0Xs4=U8Gnng@mail.gmail.com> <CADK3HHKoJ_1FYpqH-3v4rKJD+qp4UEjOE0_e8yXeekNDiD7a1w@mail.gmail.com> <2f6ef24a2fae2b42efbf9db3194392dee476f2e5.camel@cybertec.at> <CADK3HH+Bfat=byMsatf9VZ2VcG7Geu7=QJBSbJ8cTeE=sqtkAw@mail.gmail.com> <1fc1729ff4c1d342b32d0c0fb69df581f02356b1.camel@cybertec.at> <9461.1566843290@sss.pgh.pa.us>

* 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