pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: 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: psql-hackers@lists.postgresql.org
Subject: Re: Procedure support improvements
Date: Mon, 26 Aug 2019 20:06:39 +0200
Message-ID: <e96ed2592a394d48ea925ccb56583508d7eb9bf4.camel@cybertec.at> (raw)
In-Reply-To: <CADK3HH+Bfat=byMsatf9VZ2VcG7Geu7=QJBSbJ8cTeE=sqtkAw@mail.gmail.com>
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>

[CC to -hackers]
Dave Cramer wrote:
> On Mon, 26 Aug 2019 at 13:43, Laurenz Albe <laurenz.albe@cybertec.at>
> wrote:
> > Dave Cramer wrote:
> > > As I said, I'd entertain a connection parameter that switched the
> > > CALL to call procedures but ideally you'd complain to the server
> > > folks to make Procedures useful.
> > 
> > Apart from the obvious problem that procedures make life hard for 
> > the JDBC driver, because it does not know if it shall render a call
> > as SELECT or CALL:
> > What is missing in PostgreSQL procedures to make them useful?
> 
> being able to use transactions inside a procedure inside a 
> transaction.

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?

Yours,
Laurenz Albe






view thread (17+ messages)  latest in thread

Message-ID: <e96ed2592a394d48ea925ccb56583508d7eb9bf4.camel@cybertec.at>
Permalink:  ../e96ed2592a394d48ea925ccb56583508d7eb9bf4.camel@cybertec.at/
Also on:    postgresql.org/message-id/e96ed2592a394d48ea925ccb56583508d7eb9bf4.camel@cybertec.at

 · 

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: laurenz.albe@cybertec.at, pg@fastcrypt.com, gregn4422@gmail.com, david.rader@gmail.com, psql-hackers@lists.postgresql.org
  Subject: Re: Procedure support improvements
  In-Reply-To: <e96ed2592a394d48ea925ccb56583508d7eb9bf4.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> <e96ed2592a394d48ea925ccb56583508d7eb9bf4.camel@cybertec.at>

* 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