Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i2KNw-0001di-KY for pgsql-jdbc@arkaria.postgresql.org; Mon, 26 Aug 2019 19:10:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i2KNv-0006u2-B9 for pgsql-jdbc@arkaria.postgresql.org; Mon, 26 Aug 2019 19:10:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i2KNu-0006si-Vp for pgsql-jdbc@lists.postgresql.org; Mon, 26 Aug 2019 19:10:35 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i2KNs-0006v1-BO for pgsql-jdbc@lists.postgresql.org; Mon, 26 Aug 2019 19:10:34 +0000 Received: by mail-wm1-x341.google.com with SMTP id 10so562939wmp.3 for ; Mon, 26 Aug 2019 12:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=LCANtHWKRIpcBxgm8amPdZheNm87DXiyFabW43V1yf0=; b=cx2JFoZz6kP2milAKoG7chT1zl3wBAgZo/PTsOd2MQ3/LNcgchc995UW9n1RGXJYCD m2R+/blahGJ8f4UWAblp2HPPMqyv7aAoaoXlDC0ZQj3IbvTCXWvAlTqHf4dCOsWhWzCL VGIE5VzAj6m9JVVa8Ygr7yCUZT1FHkBTtkFpYff5BMvvBGD8tVdA3UyjaBHT50ZoIfoC kG5XYE1P207/4PcVQj0oCbwIGqdS4c8zjdoqMLbkXvtzpcbniRTbp9+xIox8Eh6spbcy QxM0YjslI165FecXRQT7B3VFNzoI9UgtsYmRMDuAYP8svEl2RF3Tcb8y9GOgVVL0gp+/ 2vBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=LCANtHWKRIpcBxgm8amPdZheNm87DXiyFabW43V1yf0=; b=cbVLDLWDNyOSPhw0RjyR2Dx8d2ONp9G5MlfZK0TVatpmCI3NdGQ60G1r26M/ji0UkV jpwKkPaTQGpCrG4gTrTXAnr4AaryzGXnHD3bCv4c3ZeVe9XZQUzwuV63PYVLlrneYobH 7GJX0dmJaHtLAeQXau+Y6bK4LdFKgenLMKu3jrCCZDqNWal7Gaf1pHEiaBqGwjxGC5eN yOqvBvQrPtZzyXAlWtaQq5TmFJg3kIBRfl4D3rfnDWI5q/VflPwzXslnusoU1r1NCfiH vs9e/NE8Z+D4FKyPN4jYSVUCmF7B1/V9fRKm5C3N0kDUKOkmEYK81xpmki2hhETnp/At WPjA== X-Gm-Message-State: APjAAAVh8DuZcPKovVoiK7dxaLkPrQRSrYA1oJm5xOkjxGoQQKv5GNbA pcKzR7bRAKoZh3DKQn/Z97yLqDX+doQ= X-Google-Smtp-Source: APXvYqyKUzIrhJyy4i035IZZ8VU43YFnmTk1kcDvy0AbPWeHOfwiVbOE2WDq/XDj3SVZ52YU34S59A== X-Received: by 2002:a05:600c:299:: with SMTP id 25mr23065859wmk.80.1566842800662; Mon, 26 Aug 2019 11:06:40 -0700 (PDT) Received: from localhost.localdomain (217-149-171-174.nat.highway.telekom.at. [217.149.171.174]) by smtp.gmail.com with ESMTPSA id o129sm462061wmb.41.2019.08.26.11.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 11:06:40 -0700 (PDT) Message-ID: Subject: Re: Procedure support improvements From: Laurenz Albe To: Dave Cramer Cc: Greg Nancarrow , David Rader , pgsql-jdbc@lists.postgresql.org, psql-hackers@lists.postgresql.org Date: Mon, 26 Aug 2019 20:06:39 +0200 In-Reply-To: References: <2f6ef24a2fae2b42efbf9db3194392dee476f2e5.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.4 (3.32.4-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk [CC to -hackers] Dave Cramer wrote: > On Mon, 26 Aug 2019 at 13:43, Laurenz Albe > 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